Title: [213132] releases/WebKitGTK/webkit-2.16/Source/WebKit2
Revision
213132
Author
carlo...@webkit.org
Date
2017-02-28 01:10:08 -0800 (Tue, 28 Feb 2017)

Log Message

Merge r212891 - [GTK] Crash attempting to load Flash plugin in Wayland
https://bugs.webkit.org/show_bug.cgi?id=163159

Reviewed by Michael Catanzaro.

The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
current display is Wayland.

* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
(WebKit::PluginInfoStore::getPluginInfo):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
non-X11 display.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
display is not X11.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog (213131 => 213132)


--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog	2017-02-28 09:09:14 UTC (rev 213131)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog	2017-02-28 09:10:08 UTC (rev 213132)
@@ -1,3 +1,25 @@
+2017-02-23  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [GTK] Crash attempting to load Flash plugin in Wayland
+        https://bugs.webkit.org/show_bug.cgi?id=163159
+
+        Reviewed by Michael Catanzaro.
+
+        The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
+        plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
+        current display is Wayland.
+
+        * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
+        (WebKit::PluginInfoStore::getPluginInfo):
+        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
+        (WebKit::PluginProcessProxy::scanPlugin):
+        * UIProcess/gtk/WebPageProxyGtk.cpp:
+        (WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
+        non-X11 display.
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
+        display is not X11.
+
 2017-02-23  Tomas Popela  <tpop...@redhat.com>
 
         [GTK] Drag and drop is always moving the content even if copy is requested

Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp (213131 => 213132)


--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp	2017-02-28 09:09:14 UTC (rev 213131)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp	2017-02-28 09:10:08 UTC (rev 213132)
@@ -35,6 +35,7 @@
 #include "PluginSearchPath.h"
 #include "ProcessExecutablePath.h"
 #include <WebCore/FileSystem.h>
+#include <WebCore/PlatformDisplay.h>
 #include <limits.h>
 #include <stdlib.h>
 
@@ -75,6 +76,8 @@
     if (PluginInfoCache::singleton().getPluginInfo(pluginPath, plugin)) {
 #if ENABLE(PLUGIN_PROCESS_GTK2)
         if (plugin.requiresGtk2) {
+            if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
+                return false;
             String pluginProcessPath = executablePathOfPluginProcess();
             pluginProcessPath.append('2');
             if (!fileExists(pluginProcessPath))

Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp (213131 => 213132)


--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp	2017-02-28 09:09:14 UTC (rev 213131)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp	2017-02-28 09:10:08 UTC (rev 213132)
@@ -33,6 +33,7 @@
 #include "PluginProcessCreationParameters.h"
 #include "ProcessExecutablePath.h"
 #include <WebCore/FileSystem.h>
+#include <WebCore/PlatformDisplay.h>
 #include <sys/wait.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
@@ -84,6 +85,8 @@
 #if PLATFORM(GTK)
     bool requiresGtk2 = pluginRequiresGtk2(pluginPath);
     if (requiresGtk2) {
+        if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
+            return false;
 #if ENABLE(PLUGIN_PROCESS_GTK2)
         pluginProcessPath.append('2');
         if (!fileExists(pluginProcessPath))

Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp (213131 => 213132)


--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp	2017-02-28 09:09:14 UTC (rev 213131)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp	2017-02-28 09:10:08 UTC (rev 213132)
@@ -34,6 +34,7 @@
 #include "WebPasteboardProxy.h"
 #include "WebProcessProxy.h"
 #include "WebsiteDataStore.h"
+#include <WebCore/PlatformDisplay.h>
 #include <WebCore/UserAgent.h>
 #include <gtk/gtkx.h>
 #include <wtf/NeverDestroyed.h>
@@ -102,6 +103,7 @@
 
 void WebPageProxy::createPluginContainer(uint64_t& windowID)
 {
+    RELEASE_ASSERT(WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::X11);
     GtkWidget* socket = gtk_socket_new();
     g_signal_connect(socket, "plug-removed", G_CALLBACK(pluginContainerPlugRemoved), 0);
     gtk_container_add(GTK_CONTAINER(viewWidget()), socket);

Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (213131 => 213132)


--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2017-02-28 09:09:14 UTC (rev 213131)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2017-02-28 09:10:08 UTC (rev 213132)
@@ -72,6 +72,10 @@
 #include <bindings/ScriptValue.h>
 #include <wtf/text/StringBuilder.h>
 
+#if PLUGIN_ARCHITECTURE(X11)
+#include <WebCore/PlatformDisplay.h>
+#endif
+
 using namespace JSC;
 using namespace WebCore;
 
@@ -1677,7 +1681,8 @@
 uint64_t PluginView::createPluginContainer()
 {
     uint64_t windowID = 0;
-    m_webPage->sendSync(Messages::WebPageProxy::CreatePluginContainer(), Messages::WebPageProxy::CreatePluginContainer::Reply(windowID));
+    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
+        m_webPage->sendSync(Messages::WebPageProxy::CreatePluginContainer(), Messages::WebPageProxy::CreatePluginContainer::Reply(windowID));
     return windowID;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to