Backed out changeset 0df9c1afedc2 (bug 1292317)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 05 Oct 2016 16:12:16 +0200
changeset 421212 2d065b725b7fa779218e409539fbf5318f9a222e
parent 421211 99b785435c8048dfc790766b757fd90c1036c01b
child 421213 0f1ebfbb9bda763b1f639be55b9c514b7be04f2c
push id31424
push userbmo:afarre@mozilla.com
push dateWed, 05 Oct 2016 16:04:50 +0000
bugs1292317
milestone52.0a1
backs out0df9c1afedc2eb7607863c8ba2843d9b6cbbe593
Backed out changeset 0df9c1afedc2 (bug 1292317)
browser/modules/PluginContent.jsm
modules/libpref/init/all.js
--- a/browser/modules/PluginContent.jsm
+++ b/browser/modules/PluginContent.jsm
@@ -49,18 +49,16 @@ PluginContent.prototype = {
     global.addEventListener("HiddenPlugin",          this, true);
 
     global.addMessageListener("BrowserPlugins:ActivatePlugins", this);
     global.addMessageListener("BrowserPlugins:NotificationShown", this);
     global.addMessageListener("BrowserPlugins:ContextMenuCommand", this);
     global.addMessageListener("BrowserPlugins:NPAPIPluginProcessCrashed", this);
     global.addMessageListener("BrowserPlugins:CrashReportSubmitted", this);
     global.addMessageListener("BrowserPlugins:Test:ClearCrashData", this);
-
-    Services.obs.addObserver(this, "decoder-doctor-notification", false);
   },
 
   uninit: function() {
     let global = this.global;
 
     global.removeEventListener("PluginBindingAttached", this, true);
     global.removeEventListener("PluginCrashed",         this, true);
     global.removeEventListener("PluginOutdated",        this, true);
@@ -72,19 +70,16 @@ PluginContent.prototype = {
     global.removeEventListener("HiddenPlugin",          this, true);
 
     global.removeMessageListener("BrowserPlugins:ActivatePlugins", this);
     global.removeMessageListener("BrowserPlugins:NotificationShown", this);
     global.removeMessageListener("BrowserPlugins:ContextMenuCommand", this);
     global.removeMessageListener("BrowserPlugins:NPAPIPluginProcessCrashed", this);
     global.removeMessageListener("BrowserPlugins:CrashReportSubmitted", this);
     global.removeMessageListener("BrowserPlugins:Test:ClearCrashData", this);
-
-    Services.obs.removeObserver(this, "decoder-doctor-notification");
-
     delete this.global;
     delete this.content;
   },
 
   receiveMessage: function (msg) {
     switch (msg.name) {
       case "BrowserPlugins:ActivatePlugins":
         this.activatePlugins(msg.data.pluginInfo, msg.data.newState);
@@ -118,36 +113,16 @@ PluginContent.prototype = {
       case "BrowserPlugins:Test:ClearCrashData":
         // This message should ONLY ever be sent by automated tests.
         if (Services.prefs.getBoolPref("plugins.testmode")) {
           this.pluginCrashData.clear();
         }
     }
   },
 
-  observe: function observe(aSubject, aTopic, aData) {
-    switch (aTopic) {
-      case "decoder-doctor-notification":
-        let data = JSON.parse(aData);
-        if (this.haveShownNotification &&
-            aSubject.top.document == this.content.document &&
-            data.formats.toLowerCase().includes("application/x-mpegurl", 0)) {
-          let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-          let principal = this.content.document.nodePrincipal;
-          let location = this.content.document.location.href;
-          this.global.content.pluginRequiresReload = true;
-          this.global.sendAsyncMessage("PluginContent:ShowClickToPlayNotification",
-                                       { plugins: [... this.pluginData.values()],
-                                         showNow: true,
-                                         location: location,
-                                       }, null, principal);
-        }
-    }
-  },
-
   onPageShow: function (event) {
     // Ignore events that aren't from the main document.
     if (!this.content || event.target != this.content.document) {
       return;
     }
 
     // The PluginClickToPlay events are not fired when navigating using the
     // BF cache. |persisted| is true when the page is loaded from the
@@ -160,17 +135,16 @@ PluginContent.prototype = {
   onPageHide: function (event) {
     // Ignore events that aren't from the main document.
     if (!this.content || event.target != this.content.document) {
       return;
     }
 
     this._finishRecordingFlashPluginTelemetry();
     this.clearPluginCaches();
-    this.haveShownNotification = false;
   },
 
   getPluginUI: function (plugin, anonid) {
     return plugin.ownerDocument.
            getAnonymousElementByAttribute(plugin, "anonid", anonid);
   },
 
   _getPluginInfo: function (pluginElement) {
@@ -746,21 +720,19 @@ PluginContent.prototype = {
           if (overlay) {
             overlay.removeEventListener("click", this, true);
           }
           plugin.playPlugin();
         }
       }
     }
 
-    // If there are no instances of the plugin on the page any more or if we've
-    // noted that the content needs to be reloaded due to replacing HLS, what the
+    // If there are no instances of the plugin on the page any more, what the
     // user probably needs is for us to allow and then refresh.
-    if (newState != "block" &&
-       (!pluginFound || contentWindow.pluginRequiresReload)) {
+    if (newState != "block" && !pluginFound) {
       this.reloadPage();
     }
     this.updateNotificationUI();
   },
 
   _showClickToPlayNotification: function (plugin, showNow) {
     let plugins = [];
 
@@ -812,18 +784,16 @@ PluginContent.prototype = {
       else {
         pluginInfo.pluginPermissionPrePath = principal.originNoSuffix;
         pluginInfo.pluginPermissionType = undefined;
       }
 
       this.pluginData.set(pluginInfo.permissionString, pluginInfo);
     }
 
-    this.haveShownNotification = true;
-
     this.global.sendAsyncMessage("PluginContent:ShowClickToPlayNotification", {
       plugins: [... this.pluginData.values()],
       showNow: showNow,
       location: location,
     }, null, principal);
   },
 
   /**
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -386,17 +386,17 @@ pref("media.apple.mp4.enabled", true);
 // media.gmp.storage.version.observed, and if the versions don't match,
 // we clear storage and set media.gmp.storage.version.observed=expected.
 // This provides a mechanism to clear GMP storage when non-compatible
 // changes are made.
 pref("media.gmp.storage.version.expected", 1);
 
 // Filter what triggers user notifications.
 // See DecoderDoctorDocumentWatcher::ReportAnalysis for details.
-pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMFNoSilverlight,MediaCannotInitializePulseAudio,MediaUnsupportedLibavcodec,MediaCannotPlayNoDecoders,MediaNoDecoders");
+pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMFNoSilverlight,MediaCannotInitializePulseAudio,MediaUnsupportedLibavcodec");
 // Whether we report partial failures.
 pref("media.decoder-doctor.verbose", false);
 // Whether DD should consider WMF-disabled a WMF failure, useful for testing.
 pref("media.decoder-doctor.wmf-disabled-is-failure", false);
 
 // Whether to suspend decoding of videos in background tabs.
 #ifdef NIGHTLY_BUILD
 pref("media.suspend-bkgnd-video.enabled", true);