summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/Launcher/gtk
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit2/UIProcess/Launcher/gtk
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit2/UIProcess/Launcher/gtk')
-rw-r--r--Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp36
1 files changed, 4 insertions, 32 deletions
diff --git a/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp b/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
index 94cad5fc4..8fb619ecd 100644
--- a/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
+++ b/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
@@ -28,6 +28,7 @@
#include "ProcessLauncher.h"
#include "Connection.h"
+#include "ProcessExecutablePath.h"
#include <WebCore/FileSystem.h>
#include <WebCore/ResourceHandle.h>
#include <WebCore/RunLoop.h>
@@ -52,9 +53,6 @@ using namespace WebCore;
namespace WebKit {
-const char* gWebKitWebProcessName = "WebKitWebProcess";
-const char* gWebKitPluginProcessName = "WebKitPluginProcess";
-
static void childSetupFunction(gpointer userData)
{
int socket = GPOINTER_TO_INT(userData);
@@ -77,34 +75,6 @@ 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 = getCurrentExecutablePath();
- 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;
@@ -116,7 +86,9 @@ void ProcessLauncher::launchProcess()
return;
}
- CString binaryPath = findWebKitProcess(m_launchOptions.processType == ProcessLauncher::WebProcess ? gWebKitWebProcessName : gWebKitPluginProcessName);
+ String executablePath = m_launchOptions.processType == WebProcess ?
+ executablePathOfWebProcess() : executablePathOfPluginProcess();
+ CString binaryPath = fileSystemRepresentation(executablePath);
GOwnPtr<gchar> socket(g_strdup_printf("%d", sockets[0]));
char* argv[3];
argv[0] = const_cast<char*>(binaryPath.data());