From e82f178eaa5a6d1ce171649cf0e4724e82f05de2 Mon Sep 17 00:00:00 2001 From: "thiago.santos@intel.com" Date: Wed, 30 Jan 2013 16:58:10 +0000 Subject: [PATCH] REGRESSION (r141051): Broke plugin support on non-Mac WebKit2 Ports https://bugs.webkit.org/show_bug.cgi?id=108182 Reviewed by Sam Weinig. Source/WebKit2: Send the plugin path to the PluginProcess as a parameter. * PluginProcess/qt/PluginProcessMainQt.cpp: (WebKit::PluginProcessMain): * PluginProcess/unix/PluginProcessMainUnix.cpp: (WebKit::PluginProcessMainUnix): * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp: (WebKit::PluginProcessProxy::platformInitializeLaunchOptions): * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::platformInitializeLaunchOptions): LayoutTests: Unskip failing tests. * platform/efl-wk2/TestExpectations: * platform/qt-5.0-wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141275 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 12 +++++++++++ LayoutTests/platform/efl-wk2/TestExpectations | 21 ------------------- LayoutTests/platform/qt-5.0-wk2/TestExpectations | 6 ------ Source/WebKit2/ChangeLog | 24 ++++++++++++++++++++++ .../PluginProcess/qt/PluginProcessMainQt.cpp | 1 + .../PluginProcess/unix/PluginProcessMainUnix.cpp | 4 ++-- .../UIProcess/Launcher/efl/ProcessLauncherEfl.cpp | 8 +++++--- .../UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp | 21 +++++++++++++------ .../UIProcess/Launcher/qt/ProcessLauncherQt.cpp | 9 +++++++- .../UIProcess/Plugins/qt/PluginProcessProxyQt.cpp | 1 + .../Plugins/unix/PluginProcessProxyUnix.cpp | 6 +++--- 11 files changed, 71 insertions(+), 42 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 7d59fdb..59e7f7c 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,15 @@ +2013-01-30 Thiago Marcos P. Santos + + REGRESSION (r141051): Broke plugin support on non-Mac WebKit2 Ports + https://bugs.webkit.org/show_bug.cgi?id=108182 + + Reviewed by Sam Weinig. + + Unskip failing tests. + + * platform/efl-wk2/TestExpectations: + * platform/qt-5.0-wk2/TestExpectations: + 2013-01-30 Jussi Kukkonen [EFL] Unreviewed gardening diff --git a/LayoutTests/platform/efl-wk2/TestExpectations b/LayoutTests/platform/efl-wk2/TestExpectations index 9dd0596..c815327 100644 --- a/LayoutTests/platform/efl-wk2/TestExpectations +++ b/LayoutTests/platform/efl-wk2/TestExpectations @@ -425,26 +425,5 @@ webkit.org/b/107286 fast/css/sticky/sticky-top.html [ ImageOnlyFailure ] webkit.org/b/107286 fast/css/sticky/sticky-side-margins.html [ ImageOnlyFailure ] webkit.org/b/107286 fast/css/sticky/replaced-sticky.html [ ImageOnlyFailure ] -# Broken after r141051. -webkit.org/b/108182 fast/frames/sandboxed-iframe-about-blank.html [ Skip ] -webkit.org/b/108182 fast/frames/sandboxed-iframe-navigation-allowed.html [ Skip ] -webkit.org/b/108182 fast/js/regress/integer-modulo.html [ Skip ] -webkit.org/b/108182 fast/replaced/invalid-object-with-fallback.html [ Skip ] -webkit.org/b/108182 http/tests/plugins [ Skip ] -webkit.org/b/108182 http/tests/security/contentSecurityPolicy/object-src-none-allowed.html [ Skip ] -webkit.org/b/108182 http/tests/security/cross-origin-plugin-allowed.html [ Skip ] -webkit.org/b/108182 http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html [ Skip ] -webkit.org/b/108182 http/tests/security/storage-blocking-loosened-plugin.html [ Skip ] -webkit.org/b/108182 http/tests/security/storage-blocking-loosened-private-browsing-plugin.html [ Skip ] -webkit.org/b/108182 plugins [ Skip ] -webkit.org/b/108182 fast/loader/reload-zero-byte-plugin.html [ Skip ] -webkit.org/b/108182 fast/frames/iframe-plugin-load-remove-document-crash.html [ Skip ] -webkit.org/b/108182 fast/replaced/no-focus-ring-object.html [ Skip ] -webkit.org/b/108182 fast/replaced/object-with-embed-url-param.html [ Skip ] -webkit.org/b/108182 fast/replaced/no-focus-ring-embed.html [ Skip ] -webkit.org/b/108182 http/tests/plugins/post-url-file.html [ Skip ] -webkit.org/b/108182 http/tests/plugins/plugin-document-has-focus.html [ Skip ] -webkit.org/b/108182 compositing/plugins/small-to-large-composited-plugin.html [ Skip ] - # New ruby selection test (in r140613) fails to render correctly, not generating an expected result webkit.org/b/108315 fast/ruby/select-ruby.html [ Missing ] diff --git a/LayoutTests/platform/qt-5.0-wk2/TestExpectations b/LayoutTests/platform/qt-5.0-wk2/TestExpectations index 9eb5dd1..30aa52a 100644 --- a/LayoutTests/platform/qt-5.0-wk2/TestExpectations +++ b/LayoutTests/platform/qt-5.0-wk2/TestExpectations @@ -776,9 +776,3 @@ webkit.org/b/105182 compositing/repaint/resize-repaint.html svg/text/select-textLength-spacing-stretch-1.svg svg/text/select-x-list-with-tspans-1.svg svg/text/select-x-list-1.svg - -# [WK2] REGRESSION (r141051): Broke plugin support on non-Mac WebKit2 Ports -webkit.org/b/108182 plugins [ Skip ] -webkit.org/b/108182 fast/frames/sandboxed-iframe-about-blank.html [ Skip ] -webkit.org/b/108182 fast/frames/sandboxed-iframe-navigation-allowed.html [ Skip ] -webkit.org/b/108182 fast/replaced/invalid-object-with-fallback.html [ Skip ] diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index ae45f5c..dce54c9 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,27 @@ +2013-01-30 Thiago Marcos P. Santos + + REGRESSION (r141051): Broke plugin support on non-Mac WebKit2 Ports + https://bugs.webkit.org/show_bug.cgi?id=108182 + + Reviewed by Sam Weinig. + + Send the plugin path to the PluginProcess as a parameter. + + * PluginProcess/qt/PluginProcessMainQt.cpp: + (WebKit::PluginProcessMain): + * PluginProcess/unix/PluginProcessMainUnix.cpp: + (WebKit::PluginProcessMainUnix): + * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp: + (WebKit::ProcessLauncher::launchProcess): + * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: + (WebKit::ProcessLauncher::launchProcess): + * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: + (WebKit::ProcessLauncher::launchProcess): + * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp: + (WebKit::PluginProcessProxy::platformInitializeLaunchOptions): + * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: + (WebKit::PluginProcessProxy::platformInitializeLaunchOptions): + 2013-01-30 Christophe Dumez [EFL][WK2] Use C API inside ewk_window_features diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp index db8f0b8..896f82d 100644 --- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp +++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp @@ -103,6 +103,7 @@ Q_DECL_EXPORT int PluginProcessMain(int argc, char** argv) WebKit::ChildProcessInitializationParameters parameters; parameters.connectionIdentifier = identifier; + parameters.extraInitializationData.add("plugin-path", app.arguments().at(2)); WebKit::PluginProcess::shared().initialize(parameters); diff --git a/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp index 3c595f9..3ee9de6 100644 --- a/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp +++ b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp @@ -73,9 +73,8 @@ static int webkitXError(Display* xdisplay, XErrorEvent* error) WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[]) { - ASSERT_UNUSED(argc, argc == 2 || argc == 3); bool scanPlugin = !strcmp(argv[1], "-scanPlugin"); - ASSERT_UNUSED(argc, argc == 2 || (argc == 3 && scanPlugin)); + ASSERT_UNUSED(argc, argc == 3); #if PLATFORM(GTK) gtk_init(&argc, &argv); @@ -109,6 +108,7 @@ WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[]) WebKit::ChildProcessInitializationParameters parameters; parameters.connectionIdentifier = socket; + parameters.extraInitializationData.add("plugin-path", argv[2]); WebKit::PluginProcess::shared().initialize(parameters); diff --git a/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp b/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp index d89d8f3..3a36334 100644 --- a/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp +++ b/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp @@ -42,7 +42,7 @@ void ProcessLauncher::launchProcess() return; } - CString executablePath; + CString executablePath, pluginPath; switch (m_launchOptions.processType) { case WebProcess: executablePath = executablePathOfWebProcess().utf8(); @@ -50,6 +50,7 @@ void ProcessLauncher::launchProcess() #if ENABLE(PLUGIN_PROCESS) case PluginProcess: executablePath = executablePathOfPluginProcess().utf8(); + pluginPath = m_launchOptions.extraInitializationData.get("plugin-path").utf8(); break; #endif default: @@ -63,7 +64,8 @@ void ProcessLauncher::launchProcess() #ifndef NDEBUG CString prefixedExecutablePath; if (!m_launchOptions.processCmdPrefix.isEmpty()) { - String prefixedExecutablePathStr = m_launchOptions.processCmdPrefix + ' ' + String::fromUTF8(executablePath.data()) + ' ' + socket; + String prefixedExecutablePathStr = m_launchOptions.processCmdPrefix + ' ' + + String::fromUTF8(executablePath.data()) + ' ' + socket + ' ' + String::fromUTF8(pluginPath.data()); prefixedExecutablePath = prefixedExecutablePathStr.utf8(); } #endif @@ -86,7 +88,7 @@ void ProcessLauncher::launchProcess() exit(EXIT_SUCCESS); } #endif - execl(executablePath.data(), executablePath.data(), socket, static_cast(0)); + execl(executablePath.data(), executablePath.data(), socket, pluginPath.data(), static_cast(0)); } else if (pid > 0) { // parent process; close(sockets[0]); m_processIdentifier = pid; diff --git a/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp b/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp index 1b08bd5..7c7f03a 100644 --- a/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp +++ b/Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp @@ -83,14 +83,23 @@ void ProcessLauncher::launchProcess() return; } - String executablePath = m_launchOptions.processType == WebProcess ? - executablePathOfWebProcess() : executablePathOfPluginProcess(); - CString binaryPath = fileSystemRepresentation(executablePath); + String executablePath, pluginPath; + CString realExecutablePath, realPluginPath; + if (m_launchOptions.processType == WebProcess) + executablePath = executablePathOfWebProcess(); + else { + executablePath = executablePathOfPluginProcess(); + pluginPath = m_launchOptions.extraInitializationData.get("plugin-path"); + realPluginPath = fileSystemRepresentation(pluginPath); + } + + realExecutablePath = fileSystemRepresentation(executablePath); GOwnPtr socket(g_strdup_printf("%d", sockets[0])); - char* argv[3]; - argv[0] = const_cast(binaryPath.data()); + char* argv[4]; + argv[0] = const_cast(realExecutablePath.data()); argv[1] = socket.get(); - argv[2] = 0; + argv[2] = const_cast(realPluginPath.data()); + argv[3] = 0; GOwnPtr error; int spawnFlags = G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_DO_NOT_REAP_CHILD; diff --git a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp b/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp index 8d7b7ea..36b3cdb 100644 --- a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp +++ b/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp @@ -112,12 +112,14 @@ void QtWebProcess::setupChildProcess() void ProcessLauncher::launchProcess() { - QString commandLine = QLatin1String("%1 %2 %3"); + QString commandLine; if (m_launchOptions.processType == WebProcess) { + commandLine = QLatin1String("%1 %2 %3"); QByteArray webProcessPrefix = qgetenv("QT_WEBKIT2_WP_CMD_PREFIX"); commandLine = commandLine.arg(QLatin1String(webProcessPrefix.constData())).arg(QString(executablePathOfWebProcess())); #if ENABLE(PLUGIN_PROCESS) } else if (m_launchOptions.processType == PluginProcess) { + commandLine = QLatin1String("%1 %2 %3 %4"); QByteArray pluginProcessPrefix = qgetenv("QT_WEBKIT2_PP_CMD_PREFIX"); commandLine = commandLine.arg(QLatin1String(pluginProcessPrefix.constData())).arg(QString(executablePathOfPluginProcess())); #endif @@ -170,6 +172,11 @@ void ProcessLauncher::launchProcess() commandLine = commandLine.arg(sockets[0]); #endif +#if ENABLE(PLUGIN_PROCESS) + if (m_launchOptions.processType == PluginProcess) + commandLine = commandLine.arg(QString(m_launchOptions.extraInitializationData.get("plugin-path"))); +#endif + QProcess* webProcessOrSUIDHelper = new QtWebProcess(); webProcessOrSUIDHelper->setProcessChannelMode(QProcess::ForwardedChannels); diff --git a/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp b/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp index cb4884d..7720670 100644 --- a/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp +++ b/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp @@ -53,6 +53,7 @@ class PluginProcessCreationParameters; void PluginProcessProxy::platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginModuleInfo& pluginInfo) { + launchOptions.extraInitializationData.add("plugin-path", pluginInfo.path); } void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters&) diff --git a/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp index b554f50..b269a7e 100644 --- a/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp +++ b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp @@ -43,15 +43,15 @@ using namespace WebCore; namespace WebKit { -void PluginProcessProxy::platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginModuleInfo&) +void PluginProcessProxy::platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginModuleInfo& pluginInfo) { #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", pluginInfo.path); } void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters&) -- 1.8.3.1