diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp index 730dafeed..d52cae647 100644 --- a/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp +++ b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp @@ -35,23 +35,24 @@ #include <WebCore/FileSystem.h> #include <wtf/text/CString.h> #include <wtf/text/WTFString.h> -#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) +#if PLATFORM(GTK) || PLATFORM(EFL) #include <glib.h> +#include <wtf/gobject/GOwnPtr.h> #endif using namespace WebCore; namespace WebKit { -void PluginProcessProxy::platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginModuleInfo&) +void PluginProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginProcessAttributes& pluginProcessAttributes) { #if PLATFORM(EFL) && !defined(NDEBUG) const char* commandPrefix = getenv("PLUGIN_PROCESS_COMMAND_PREFIX"); if (commandPrefix && *commandPrefix) launchOptions.processCmdPrefix = String::fromUTF8(commandPrefix); -#else - UNUSED_PARAM(launchOptions); #endif + + launchOptions.extraInitializationData.add("plugin-path", pluginProcessAttributes.moduleInfo.path); } void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters&) @@ -60,7 +61,7 @@ void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationPa bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result) { -#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) +#if PLATFORM(GTK) || PLATFORM(EFL) CString binaryPath = fileSystemRepresentation(executablePathOfPluginProcess()); CString pluginPathCString = fileSystemRepresentation(pluginPath); char* argv[4]; @@ -70,7 +71,7 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& argv[3] = 0; int status; - char* stdOut = 0; + GOwnPtr<char> stdOut; // If the disposition of SIGCLD signal is set to SIG_IGN (default) // then the signal will be ignored and g_spawn_sync() will not be @@ -84,16 +85,13 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& sigaction(SIGCLD, &action, 0); } - if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut, 0, &status, 0)) + if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut.outPtr(), 0, &status, 0)) return false; - if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS || !stdOut) { - free(stdOut); + if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS || !stdOut) return false; - } - String stdOutString(reinterpret_cast<const UChar*>(stdOut)); - free(stdOut); + String stdOutString(reinterpret_cast<const UChar*>(stdOut.get())); Vector<String> lines; stdOutString.split(UChar('\n'), true, lines); @@ -105,9 +103,9 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result.description.swap(lines[1]); result.mimeDescription.swap(lines[2]); return !result.mimeDescription.isEmpty(); -#else // PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) +#else // PLATFORM(GTK) || PLATFORM(EFL) return false; -#endif // PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) +#endif // PLATFORM(GTK) || PLATFORM(EFL) } } // namespace WebKit |