Bug 1548475 - [Wayland] Disable Flash on Wayland backend, r=jmathies
☠☠ backed out by 374e8e43a94e ☠ ☠
authorMartin Stransky <stransky@redhat.com>
Thu, 09 May 2019 15:03:13 +0000
changeset 535179 d1615ffd338f011c56be6810eda9bd53782c272a
parent 535178 3315610792f4b94ab15a102fa8119efec42f9a2e
child 535180 faddb8bb87a83a223a2e68f6c2b21f6e45ffb948
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmathies
bugs1548475
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1548475 - [Wayland] Disable Flash on Wayland backend, r=jmathies Differential Revision: https://phabricator.services.mozilla.com/D30020
dom/plugins/base/nsPluginHost.cpp
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -100,16 +100,20 @@
 #include "mozilla/dom/Promise.h"
 
 #if defined(XP_WIN)
 #  include "nsIWindowMediator.h"
 #  include "nsIBaseWindow.h"
 #  include "windows.h"
 #  include "winbase.h"
 #endif
+#if (MOZ_WIDGET_GTK)
+#  include <gdk/gdk.h>
+#  include <gdk/gdkx.h>
+#endif
 
 #include "npapi.h"
 
 using namespace mozilla;
 using mozilla::TimeStamp;
 using mozilla::dom::Document;
 using mozilla::dom::FakePluginMimeEntry;
 using mozilla::dom::FakePluginTagInit;
@@ -353,19 +357,25 @@ nsPluginHost::nsPluginHost()
       mOverrideInternalTypes(false),
       mPluginsDisabled(false),
       mPluginEpoch(0) {
   // check to see if pref is set at startup to let plugins take over in
   // full page mode for certain image mime types that we handle internally
   mOverrideInternalTypes =
       Preferences::GetBool("plugin.override_internal_types", false);
 
-  mPluginsDisabled = Preferences::GetBool("plugin.disable", false);
-
-  Preferences::AddStrongObserver(this, "plugin.disable");
+  bool waylandBackend = false;
+#if MOZ_WIDGET_GTK
+  waylandBackend = !GDK_IS_X11_DISPLAY(gdk_display_get_default());
+#endif
+  mPluginsDisabled =
+      Preferences::GetBool("plugin.disable", false) || waylandBackend;
+  if (!waylandBackend) {
+    Preferences::AddStrongObserver(this, "plugin.disable");
+  }
 
   nsCOMPtr<nsIObserverService> obsService =
       mozilla::services::GetObserverService();
   if (obsService) {
     obsService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
     if (XRE_IsParentProcess()) {
       obsService->AddObserver(this, "plugin-blocklist-updated", false);
     }