WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch sans debug fprintf
bug-73473-20111130202226.patch (text/plain), 10.52 KB, created by
Martin Robinson
on 2011-11-30 11:22:29 PST
(
hide
)
Description:
Patch sans debug fprintf
Filename:
MIME Type:
Creator:
Martin Robinson
Created:
2011-11-30 11:22:29 PST
Size:
10.52 KB
patch
obsolete
>Subversion Revision: 101523 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index c5f049a0020cffee816aac45486fc35fe378af5d..f842b53c97dde9be8e2158342a768ad01f582426 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,18 @@ >+2011-11-30 Martin Robinson <mrobinson@igalia.com> >+ >+ [GTK] Add a helper function to find the current executable's path >+ https://bugs.webkit.org/show_bug.cgi?id=73473 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a WTF which gets the binary path. This is currently only used >+ in WebKit2. >+ >+ * GNUmakefile.list.am: Add the new file to the source list. >+ * wtf/gobject/GlibUtilities.cpp: Added. >+ (getCurrentBinaryPath): >+ * wtf/gobject/GlibUtilities.h: Added. >+ > 2011-11-30 Adam Roben <aroben@apple.com> > > Fix RetainPtr's move assignment operators >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index a55e4fb168b18167dafe0e01ed9bda35887294fe..505a2b12e567de039b96d884c1f22ed51d4c8d25 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,19 @@ >+2011-11-30 Martin Robinson <mrobinson@igalia.com> >+ >+ [GTK] Add a helper function to find the current executable's path >+ https://bugs.webkit.org/show_bug.cgi?id=73473 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Do a series of tests when looking for processes. First search the directory >+ specified by the environment variable, then the directory of the binary and >+ then the LIBEXECDIR. >+ >+ * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: >+ (WebKit::findWebKitProcess): Added. >+ (WebKit::ProcessLauncher::launchProcess): Call the new helper to get the >+ binary location. >+ > 2011-11-30 Mario Sanchez Prada <msanchez@igalia.com> > > [Gtk] Links should be Tab-focusable by default >diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am >index a34c200590d3844c74ec84c3b2e57ea3de1bec35..37e1778b39203a80f1e8dc34096acc6bb6cf48c7 100644 >--- a/Source/JavaScriptCore/GNUmakefile.list.am >+++ b/Source/JavaScriptCore/GNUmakefile.list.am >@@ -564,6 +564,8 @@ javascriptcore_sources += \ > Source/JavaScriptCore/wtf/gobject/GRefPtr.cpp \ > Source/JavaScriptCore/wtf/gobject/GRefPtr.h \ > Source/JavaScriptCore/wtf/gobject/GTypedefs.h \ >+ Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp \ >+ Source/JavaScriptCore/wtf/gobject/GlibUtilities.h \ > Source/JavaScriptCore/wtf/gtk/MainThreadGtk.cpp \ > Source/JavaScriptCore/wtf/HashCountedSet.h \ > Source/JavaScriptCore/wtf/HashFunctions.h \ >diff --git a/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..aaa169a1e1df1a53f26d463a8364d03acf505908 >--- /dev/null >+++ b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp >@@ -0,0 +1,35 @@ >+/* >+ * Copyright (C) 2010 Igalia, S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "GlibUtilities.h" >+ >+#include <limits.h> >+#include <unistd.h> >+ >+#if OS(LINUX) >+CString getCurrentBinaryPath() >+{ >+ static char readLinkBuffer[PATH_MAX]; >+ ssize_t result = readlink("/proc/self/exe", readLinkBuffer, PATH_MAX); >+ if (result == -1) >+ return CString(); >+ return CString(readLinkBuffer, result); >+} >+#endif >diff --git a/Source/JavaScriptCore/wtf/gobject/GlibUtilities.h b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.h >new file mode 100644 >index 0000000000000000000000000000000000000000..efe9b05a1caf3663617c35612ffbda54197da141 >--- /dev/null >+++ b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.h >@@ -0,0 +1,27 @@ >+/* >+ * Copyright (C) 2010 Igalia, S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#ifndef GlibUtilities_h >+#define GlibUtilities_h >+ >+#include "CString.h" >+ >+CString getCurrentBinaryPath(); >+ >+#endif >diff --git a/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp b/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp >index 1ffcba214bbebf884b154c8e2f374f6dcebb12d2..c5e0345cca42357bcb5aa7347cf7b8370945f3a7 100644 >--- a/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp >+++ b/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp >@@ -38,6 +38,7 @@ > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > #include <wtf/gobject/GOwnPtr.h> >+#include <wtf/gobject/GlibUtilities.h> > > #ifdef SOCK_SEQPACKET > #define SOCKET_TYPE SOCK_SEQPACKET >@@ -71,6 +72,34 @@ static void childFinishedFunction(GPid, gint status, gpointer userData) > close(GPOINTER_TO_INT(userData)); > } > >+static CString findWebKitProcess(const char* processName) >+{ >+ const char* execDirectory = g_getenv("WEBKIT_EXEC_PATH"); >+ if (execDirectory) { >+ String processPath = pathByAppendingComponent(filenameToString(execDirectory), processName); >+ if (fileExists(processPath)) >+ return fileSystemRepresentation(processPath); >+ } >+ >+ static bool gotExecutablePath = false; >+ static String executablePath; >+ if (!gotExecutablePath) { >+ gotExecutablePath = true; >+ >+ CString executableFile = getCurrentBinaryPath(); >+ if (!executableFile.isNull()) >+ executablePath = directoryName(filenameToString(executableFile.data())); >+ } >+ >+ if (!executablePath.isNull()) { >+ String processPath = pathByAppendingComponent(executablePath, processName); >+ if (fileExists(processPath)) >+ return fileSystemRepresentation(processPath); >+ } >+ >+ return fileSystemRepresentation(pathByAppendingComponent(filenameToString(LIBEXECDIR), processName)); >+} >+ > void ProcessLauncher::launchProcess() > { > GPid pid = 0; >@@ -82,12 +111,10 @@ void ProcessLauncher::launchProcess() > return; > } > >- const gchar* execDirectory = g_getenv("WEBKIT_EXEC_PATH"); >- GOwnPtr<gchar> binaryPath(g_build_filename(execDirectory ? execDirectory : LIBEXECDIR, >- m_launchOptions.processType == ProcessLauncher::WebProcess ? gWebKitWebProcessName : gWebKitPluginProcessName, NULL)); >+ CString binaryPath = findWebKitProcess(m_launchOptions.processType == ProcessLauncher::WebProcess ? gWebKitWebProcessName : gWebKitPluginProcessName); > GOwnPtr<gchar> socket(g_strdup_printf("%d", sockets[0])); > char* argv[3]; >- argv[0] = binaryPath.get(); >+ argv[0] = const_cast<char*>(binaryPath.data()); > argv[1] = socket.get(); > argv[2] = 0; > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 17b5c65e8406e32012205103689a344c7df4ea7d..7033e4ed61ac7117ac0ee4a7299a49e68cc90ec8 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,5 +1,20 @@ > 2011-11-30 Martin Robinson <mrobinson@igalia.com> > >+ [GTK] Add a helper function to find the current executable's path >+ https://bugs.webkit.org/show_bug.cgi?id=73473 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update MiniBrowser to not pass the binary directory as an environment variable. >+ This means that you can move the binaries around without it breaking. >+ >+ * MiniBrowser/gtk/main.c: >+ (main): No longer set the environment variable. >+ * WebKitTestRunner/GNUmakefile.am: No longer add the directory path define. >+ * WebKitTestRunner/gtk/main.cpp: Ditto. >+ >+2011-11-30 Martin Robinson <mrobinson@igalia.com> >+ > [GTK] Add an initial jhbuild setup which installs fonts into the WebKitBuild > https://bugs.webkit.org/show_bug.cgi?id=73425 > >diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c >index 0c3f3f20e8d770cc9d7fb478b02855cafc717a0e..92dd1b0aaf8b09d0fa76d92317d896ea5d4e3234 100644 >--- a/Tools/MiniBrowser/gtk/main.c >+++ b/Tools/MiniBrowser/gtk/main.c >@@ -76,9 +76,6 @@ int main(int argc, char *argv[]) > } > g_option_context_free (context); > >- // Prefer the not installed web and plugin processes. >- g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE); >- > if (uriArguments) { > int i; > >diff --git a/Tools/WebKitTestRunner/GNUmakefile.am b/Tools/WebKitTestRunner/GNUmakefile.am >index 8ddce1240cfb8e31036679b7eec17f33ea12a942..16ff328e999c74b42c04fabde3bedfe387b8308e 100644 >--- a/Tools/WebKitTestRunner/GNUmakefile.am >+++ b/Tools/WebKitTestRunner/GNUmakefile.am >@@ -33,7 +33,6 @@ Programs_WebKitTestRunner_CPPFLAGS = \ > -I$(srcdir)/Tools/WebKitTestRunner \ > -I$(srcdir)/Source/WebCore/platform/gtk \ > -I$(top_builddir)/DerivedSources/WebKit2/include \ >- -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs/\" \ > $(global_cppflags) \ > $(javascriptcore_cppflags) \ > $(GLOBALDEPS_CFLAGS) \ >diff --git a/Tools/WebKitTestRunner/gtk/main.cpp b/Tools/WebKitTestRunner/gtk/main.cpp >index 4ed8ffbd341b7c09e7eda53775ab0cc15e1d16c6..d53c6248a94713afe1a0275036e2f6388d6da786 100644 >--- a/Tools/WebKitTestRunner/gtk/main.cpp >+++ b/Tools/WebKitTestRunner/gtk/main.cpp >@@ -32,7 +32,6 @@ int main(int argc, char** argv) > { > gtk_init(&argc, &argv); > // Prefer the not installed web and plugin processes. >- g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE); > WTR::TestController controller(argc, const_cast<const char**>(argv)); > return 0; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 73473
:
117232
|
117234
|
117398