Title: [187641] trunk/Source/WebKit2
Revision
187641
Author
carlo...@webkit.org
Date
2015-07-31 05:24:05 -0700 (Fri, 31 Jul 2015)

Log Message

[GTK] NPAPI code crashes on Wayland
https://bugs.webkit.org/show_bug.cgi?id=147297

Reviewed by Žan Doberšek.

Do not crete NPAPI plugins when runing on Wayland, since they are
not supported. ENABLE_NETSCAPE_PLUGIN_API option used to be
incompatible with building with the Wayland target, but now that
we allow to build X11 and Wayland targets at the same time, we
need runtime checks to avoid creating NPAPI plugins in Wayland.

* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_set_enable_plugins): Do not allow to change the
setting when running in Wayland.
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore): Initialize
EnablePlugins preference to false when running in Wayland.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187640 => 187641)


--- trunk/Source/WebKit2/ChangeLog	2015-07-31 08:06:37 UTC (rev 187640)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-31 12:24:05 UTC (rev 187641)
@@ -1,3 +1,23 @@
+2015-07-31  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [GTK] NPAPI code crashes on Wayland
+        https://bugs.webkit.org/show_bug.cgi?id=147297
+
+        Reviewed by Žan Doberšek.
+
+        Do not crete NPAPI plugins when runing on Wayland, since they are
+        not supported. ENABLE_NETSCAPE_PLUGIN_API option used to be
+        incompatible with building with the Wayland target, but now that
+        we allow to build X11 and Wayland targets at the same time, we
+        need runtime checks to avoid creating NPAPI plugins in Wayland.
+
+        * UIProcess/API/gtk/WebKitSettings.cpp:
+        (webkit_settings_set_enable_plugins): Do not allow to change the
+        setting when running in Wayland.
+        * UIProcess/gtk/WebPreferencesGtk.cpp:
+        (WebKit::WebPreferences::platformInitializeStore): Initialize
+        EnablePlugins preference to false when running in Wayland.
+
 2015-07-30  Joseph Pecoraro  <pecor...@apple.com>
 
         LayoutTests/inspector frequently run slow and timeout when run in WebKit2 but not WebKit1

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp (187640 => 187641)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp	2015-07-31 08:06:37 UTC (rev 187640)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp	2015-07-31 12:24:05 UTC (rev 187641)
@@ -40,6 +40,10 @@
 #include <glib/gi18n-lib.h>
 #include <wtf/text/CString.h>
 
+#if PLATFORM(WAYLAND)
+#include <WebCore/PlatformDisplay.h>
+#endif
+
 using namespace WebKit;
 
 struct _WebKitSettingsPrivate {
@@ -1590,6 +1594,12 @@
 {
     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
 
+#if PLATFORM(WAYLAND)
+    // Do not allow to change this setting in Wayland, since plugins are not supported.
+    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::Wayland)
+        return;
+#endif
+
     WebKitSettingsPrivate* priv = settings->priv;
     bool currentValue = priv->preferences->pluginsEnabled();
     if (currentValue == enabled)

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp (187640 => 187641)


--- trunk/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp	2015-07-31 08:06:37 UTC (rev 187640)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp	2015-07-31 12:24:05 UTC (rev 187641)
@@ -35,10 +35,13 @@
 void WebPreferences::platformInitializeStore()
 {
 #if PLATFORM(WAYLAND)
-    // FIXME: Accelerated compositing under Wayland is not yet supported.
-    // https://bugs.webkit.org/show_bug.cgi?id=115803
-    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::Wayland)
+    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::Wayland) {
+        // FIXME: Accelerated compositing under Wayland is not yet supported.
+        // https://bugs.webkit.org/show_bug.cgi?id=115803
         setAcceleratedCompositingEnabled(false);
+
+        setPluginsEnabled(false);
+    }
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to