REGRESSION (r141051): Broke plugin support on non-Mac WebKit2 Ports
authorthiago.santos@intel.com <thiago.santos@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 16:58:10 +0000 (16:58 +0000)
committerthiago.santos@intel.com <thiago.santos@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 16:58:10 +0000 (16:58 +0000)
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
LayoutTests/platform/efl-wk2/TestExpectations
LayoutTests/platform/qt-5.0-wk2/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp
Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp
Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp

index 7d59fdb..59e7f7c 100644 (file)
@@ -1,3 +1,15 @@
+2013-01-30  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        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  <jussi.kukkonen@intel.com>
 
         [EFL] Unreviewed gardening
index 9dd0596..c815327 100644 (file)
@@ -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 ]
index 9eb5dd1..30aa52a 100644 (file)
@@ -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 ]
index ae45f5c..dce54c9 100644 (file)
@@ -1,3 +1,27 @@
+2013-01-30  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        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  <christophe.dumez@intel.com>
 
         [EFL][WK2] Use C API inside ewk_window_features
index db8f0b8..896f82d 100644 (file)
@@ -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);
 
index 3c595f9..3ee9de6 100644 (file)
@@ -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);
 
index d89d8f3..3a36334 100644 (file)
@@ -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<char*>(0));
+        execl(executablePath.data(), executablePath.data(), socket, pluginPath.data(), static_cast<char*>(0));
     } else if (pid > 0) { // parent process;
         close(sockets[0]);
         m_processIdentifier = pid;
index 1b08bd5..7c7f03a 100644 (file)
@@ -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<gchar> socket(g_strdup_printf("%d", sockets[0]));
-    char* argv[3];
-    argv[0] = const_cast<char*>(binaryPath.data());
+    char* argv[4];
+    argv[0] = const_cast<char*>(realExecutablePath.data());
     argv[1] = socket.get();
-    argv[2] = 0;
+    argv[2] = const_cast<char*>(realPluginPath.data());
+    argv[3] = 0;
 
     GOwnPtr<GError> error;
     int spawnFlags = G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_DO_NOT_REAP_CHILD;
index 8d7b7ea..36b3cdb 100644 (file)
@@ -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);
 
index cb4884d..7720670 100644 (file)
@@ -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&)
index b554f50..b269a7e 100644 (file)
@@ -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&)