[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-31.5.0esr-4.5-1] Revert "Bug 10280: Don't load any plugins into the address space."



commit c7f790c503265c0b48a69668e34e65e8f7a8e5e5
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
Date:   Tue Mar 24 17:22:03 2015 -0700

    Revert "Bug 10280: Don't load any plugins into the address space."
    
    This reverts commit 7c5fee267428865a1d93c9e44df5c373f8d01569.
---
 dom/plugins/base/nsPluginHost.cpp                  |   11 ---
 toolkit/mozapps/extensions/content/extensions.js   |   75 +-------------------
 toolkit/mozapps/extensions/content/extensions.xul  |   23 ------
 .../mozapps/extensions/internal/PluginProvider.jsm |   11 ---
 4 files changed, 3 insertions(+), 117 deletions(-)

diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp
index 68ac197..1efe59f 100644
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -3105,7 +3105,6 @@ NS_IMETHODIMP nsPluginHost::Observe(nsISupports *aSubject,
     sInst->Release();
   }
   if (!strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic)) {
-    NS_ConvertUTF16toUTF8 prefName(someData);
     mPluginsDisabled = Preferences::GetBool("plugin.disable", false);
     mPluginsClickToPlay = Preferences::GetBool("plugins.click_to_play", false);
     // Unload or load plugins as needed
@@ -3114,16 +3113,6 @@ NS_IMETHODIMP nsPluginHost::Observe(nsISupports *aSubject,
     } else {
       LoadPlugins();
     }
-    if (prefName.Equals("plugin.disable")) {
-      nsCOMPtr<nsIObserverService> obsService =
-        mozilla::services::GetObserverService();
-      if (obsService) {
-        nsAutoString pluginPolicy;
-        pluginPolicy = mPluginsDisabled ? NS_LITERAL_STRING("disabled")
-                                        : NS_LITERAL_STRING("enabled");
-        obsService->NotifyObservers(nullptr, "plugins-policy-changed", pluginPolicy.get());
-      }
-    }
   }
   if (!strcmp("blocklist-updated", aTopic)) {
     nsPluginTag* plugin = mPlugins;
diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js
index 6790841..35d2392 100644
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -858,20 +858,6 @@ var gViewController = {
       }
     },
 
-    cmd_goToEnablePlugins: {
-      isEnabled: function cmd_goToEnablePlugins_isEnabled() true,
-      doCommand: function cmd_goToEnablePlugins_doCommand() {
-        Services.prefs.setBoolPref("plugin.disable", false);
-      }
-    },
-
-    cmd_goToDisablePlugins: {
-      isEnabled: function cmd_goToDisablePlugins_isEnabled() true,
-      doCommand: function cmd_goToDisablePlugins_doCommand() {
-        Services.prefs.setBoolPref("plugin.disable", true);
-      }
-    },
-
     cmd_goToRecentUpdates: {
       isEnabled: function cmd_goToRecentUpdates_isEnabled() true,
       doCommand: function cmd_goToRecentUpdates_doCommand() {
@@ -2567,17 +2553,12 @@ var gListView = {
   node: null,
   _listBox: null,
   _emptyNotice: null,
-  _pluginDisabledNotice: null,
-  _pluginEnabledNotice: null,
   _type: null,
-  _pluginListEmpty: false,
 
   initialize: function gListView_initialize() {
     this.node = document.getElementById("list-view");
     this._listBox = document.getElementById("addon-list");
     this._emptyNotice = document.getElementById("addon-list-empty");
-    this._pluginDisabledNotice = document.getElementById("plugin-disabled");
-    this._pluginEnabledNotice = document.getElementById("plugin-enabled");
 
     var self = this;
     this._listBox.addEventListener("keydown", function listbox_onKeydown(aEvent) {
@@ -2589,10 +2570,6 @@ var gListView = {
     }, false);
   },
 
-  shutdown: function gListView_shutdown() {
-    AddonManager.removeAddonListener(this);
-  },
-
   show: function gListView_show(aType, aRequest) {
     if (!(aType in AddonManager.addonTypes))
       throw Components.Exception("Attempting to show unknown type " + aType, Cr.NS_ERROR_INVALID_ARG);
@@ -2600,12 +2577,9 @@ var gListView = {
     this._type = aType;
     this.node.setAttribute("type", aType);
     this.showEmptyNotice(false);
-    this.showPluginEnabledNotice(false);
-    this.showPluginDisabledNotice(false);
 
     while (this._listBox.itemCount > 0)
       this._listBox.removeItemAt(0);
-    this._pluginListEmpty = true;
 
     var self = this;
     getAddonsAndInstalls(aType, function show_getAddonsAndInstalls(aAddonsList, aInstallsList) {
@@ -2620,22 +2594,20 @@ var gListView = {
       for (let installItem of aInstallsList)
         elements.push(createItem(installItem, true));
 
+      self.showEmptyNotice(elements.length == 0);
       if (elements.length > 0) {
         sortElements(elements, ["uiState", "name"], true);
         for (let element of elements)
           self._listBox.appendChild(element);
       }
-      self.showAllNeedNotices(true);
 
       gEventManager.registerInstallListener(self);
       gViewController.updateCommands();
       gViewController.notifyViewChanged();
-      AddonManager.addAddonListener(self);
     });
   },
 
   hide: function gListView_hide() {
-    AddonManager.removeAddonListener(this);
     gEventManager.unregisterInstallListener(this);
     doPendingUninstalls(this._listBox);
   },
@@ -2644,43 +2616,6 @@ var gListView = {
     this._emptyNotice.hidden = !aShow;
   },
 
-  showPluginDisabledNotice: function gListView_showPluginDisabledNotice(aShow) {
-    this._pluginDisabledNotice.hidden = !aShow;
-  },
-
-  showPluginEnabledNotice: function gListView_showPluginEnabledNotice(aShow) {
-    this._pluginEnabledNotice.hidden = !aShow;
-  },
-
-  showAllNeedNotices: function gListView_showAllNeedNotices(aShow) {
-      var empty_list = (this._listBox.itemCount == 0);
-      var show_empty_notice = true;
-
-      if (this._type == "plugin") {
-        var update_notices = (this._pluginListEmpty != empty_list);
-        this._pluginListEmpty = empty_list;
-
-        if (update_notices || aShow) {
-          var plugin_disable = false;
-
-          try {
-            plugin_disable = Services.prefs.getBoolPref("plugin.disable")
-          } catch (e) {}
-
-          if (plugin_disable == true) {
-            this.showPluginEnabledNotice(false);
-            this.showPluginDisabledNotice(true);
-            show_empty_notice = false;
-          } else {
-            this.showPluginDisabledNotice(false);
-            this.showPluginEnabledNotice(true);
-          }
-        }
-      }
-      if (show_empty_notice == true)
-        this.showEmptyNotice(empty_list);
-  },
-
   onSortChanged: function gListView_onSortChanged(aSortBy, aAscending) {
     sortList(this._listBox, aSortBy, aAscending);
   },
@@ -2723,10 +2658,6 @@ var gListView = {
     }
   },
 
-  onUninstalled: function gListView_onUninstalled()  {
-    this.showAllNeedNotices(false);
-  },
-
   addItem: function gListView_addItem(aObj, aIsInstall) {
     if (aObj.type != this._type)
       return;
@@ -2742,7 +2673,7 @@ var gListView = {
 
     let item = createItem(aObj, aIsInstall);
     this._listBox.insertBefore(item, this._listBox.firstChild);
-    this.showAllNeedNotices(false);
+    this.showEmptyNotice(false);
   },
 
   removeItem: function gListView_removeItem(aObj, aIsInstall) {
@@ -2751,7 +2682,7 @@ var gListView = {
     for (let item of this._listBox.childNodes) {
       if (item[prop] == aObj) {
         this._listBox.removeChild(item);
-        this.showAllNeedNotices(false);
+        this.showEmptyNotice(this._listBox.itemCount == 0);
         return;
       }
     }
diff --git a/toolkit/mozapps/extensions/content/extensions.xul b/toolkit/mozapps/extensions/content/extensions.xul
index 1c2bb07..d247bdf 100644
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -79,8 +79,6 @@
     <command id="cmd_findAllUpdates"/>
     <command id="cmd_restartApp"/>
     <command id="cmd_goToDiscoverPane"/>
-    <command id="cmd_goToEnablePlugins"/>
-    <command id="cmd_goToDisablePlugins"/>
     <command id="cmd_goToRecentUpdates"/>
     <command id="cmd_goToAvailableUpdates"/>
     <command id="cmd_installFromFile"/>
@@ -388,28 +386,7 @@
             </vbox>
             <spacer class="alert-spacer-after"/>
           </vbox>
-          <vbox id="plugin-disabled" class="alert-container"
-                flex="1" hidden="true">
-            <spacer class="alert-spacer-before"/>
-            <vbox class="alert">
-              <label value="&plugins.installed.find;"/>
-              <button class="button-enableplugin"
-                      label="&plugins.installed.enable;"
-                      command="cmd_goToEnablePlugins"/>
-            </vbox>
-            <spacer class="alert-spacer-after"/>
-          </vbox>
           <richlistbox id="addon-list" class="list" flex="1"/>
-          <vbox id="plugin-enabled" class="view-header global-info-container"
-                hidden="true">
-            <vbox class="global-info" flex="1"  align="center">
-              <button class="button-disableplugin"
-                      label="&plugins.installed.disable;"
-                      tooltiptext="&plugins.installed.disable.tip;"
-                      command="cmd_goToDisablePlugins"/>
-              <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
-            </vbox>
-          </vbox>
         </vbox>
 
         <!-- updates view -->
diff --git a/toolkit/mozapps/extensions/internal/PluginProvider.jsm b/toolkit/mozapps/extensions/internal/PluginProvider.jsm
index 2cf2583..7b6e335 100644
--- a/toolkit/mozapps/extensions/internal/PluginProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm
@@ -52,7 +52,6 @@ var PluginProvider = {
   plugins: null,
 
   startup: function PL_startup() {
-    Services.obs.addObserver(this, "plugins-policy-changed", false);
     Services.obs.addObserver(this, LIST_UPDATED_TOPIC, false);
     Services.obs.addObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, false);
   },
@@ -65,7 +64,6 @@ var PluginProvider = {
     this.plugins = null;
     Services.obs.removeObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED);
     Services.obs.removeObserver(this, LIST_UPDATED_TOPIC);
-    Services.obs.removeObserver(this, "plugins-policy-changed");
   },
 
   observe: function(aSubject, aTopic, aData) {
@@ -91,15 +89,6 @@ var PluginProvider = {
       if (this.plugins)
         this.updatePluginList();
       break;
-    case "plugins-policy-changed":
-      var plugin_policy = aData
-      if (!this.plugins)
-        this.plugins =[];
-      this.updatePluginList();
-      Services.obs.notifyObservers(null,
-                                   "plugin-provider-after-changed-policy",
-                                   plugin_policy);
-      break;
     }
   },
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits