[GTK] Add a helper function to find the current executable's path
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 22:31:26 +0000 (22:31 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 22:31:26 +0000 (22:31 +0000)
commita989f0e9f4bc5460787281c82871aa7bf96926f3
tree4230913a066b5c7cfcbe554072b3543b38d318db
parentf76bb38909371a280721f255d264da2626b40760
[GTK] Add a helper function to find the current executable's path
https://bugs.webkit.org/show_bug.cgi?id=73473

Reviewed by Gustavo Noronha Silva.

Source/JavaScriptCore:

Add a WTF helper 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.
(getCurrentExecutablePath):
* wtf/gobject/GlibUtilities.h: Added.

Source/WebCore:

No new tests. This should not change behavior.

* platform/gtk/FileSystemGtk.cpp:
(WebCore::applicationDirectoryPath): Now use the new WTF function to get the
current executable's path.

Source/WebKit2:

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.

Tools:

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp [new file with mode: 0644]
Source/JavaScriptCore/wtf/gobject/GlibUtilities.h [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/gtk/FileSystemGtk.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Tools/ChangeLog
Tools/MiniBrowser/gtk/main.c
Tools/WebKitTestRunner/GNUmakefile.am
Tools/WebKitTestRunner/gtk/main.cpp