Bug 1443870 - remove content-process blocklist service, r?florian draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 14 Mar 2018 12:12:01 +0000
changeset 767352 9249e30ef509d666822f73914de5c52b0a0a477c
parent 767347 80b4777a6421d8df4bb27ac23fb607c318a3006c
child 767551 4b9d50f2b2960f8dcc33257a2cde87e3817e9484
child 768017 6dd067028dc1295f86938730f7b6300d2b488d9c
push id102567
push usergijskruitbosch@gmail.com
push dateWed, 14 Mar 2018 12:12:44 +0000
reviewersflorian
bugs1443870
milestone61.0a1
Bug 1443870 - remove content-process blocklist service, r?florian MozReview-Commit-ID: KmlQ99rA201
browser/installer/package-manifest.in
toolkit/mozapps/extensions/extensions.manifest
toolkit/mozapps/extensions/moz.build
toolkit/mozapps/extensions/nsBlocklistServiceContent.js
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -412,17 +412,16 @@
 @RESPATH@/components/extensions.manifest
 @RESPATH@/components/EditorUtils.manifest
 @RESPATH@/components/EditorUtils.js
 @RESPATH@/components/addonManager.js
 @RESPATH@/components/amContentHandler.js
 @RESPATH@/components/amInstallTrigger.js
 @RESPATH@/components/amWebAPI.js
 @RESPATH@/components/nsBlocklistService.js
-@RESPATH@/components/nsBlocklistServiceContent.js
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 @RESPATH@/components/nsUpdateService.js
 @RESPATH@/components/nsUpdateServiceStub.js
 #endif
 @RESPATH@/components/nsUpdateTimerManager.manifest
 @RESPATH@/components/nsUpdateTimerManager.js
 @RESPATH@/components/utils.manifest
--- a/toolkit/mozapps/extensions/extensions.manifest
+++ b/toolkit/mozapps/extensions/extensions.manifest
@@ -1,13 +1,11 @@
 component {66354bc9-7ed1-4692-ae1d-8da97d6b205e} nsBlocklistService.js process=main
 contract @mozilla.org/extensions/blocklist;1 {66354bc9-7ed1-4692-ae1d-8da97d6b205e} process=main
 category profile-after-change nsBlocklistService @mozilla.org/extensions/blocklist;1  process=main
-component {e0a106ed-6ad4-47a4-b6af-2f1c8aa4712d} nsBlocklistServiceContent.js process=content
-contract @mozilla.org/extensions/blocklist;1 {e0a106ed-6ad4-47a4-b6af-2f1c8aa4712d} process=content
 
 category update-timer nsBlocklistService @mozilla.org/extensions/blocklist;1,getService,blocklist-background-update-timer,extensions.blocklist.interval,86400
 component {4399533d-08d1-458c-a87a-235f74451cfa} addonManager.js
 contract @mozilla.org/addons/integration;1 {4399533d-08d1-458c-a87a-235f74451cfa}
 #ifndef MOZ_WIDGET_ANDROID
 category update-timer addonManager @mozilla.org/addons/integration;1,getService,addon-background-update-timer,extensions.update.interval,86400
 #endif
 component {7beb3ba8-6ec3-41b4-b67c-da89b8518922} amContentHandler.js
--- a/toolkit/mozapps/extensions/moz.build
+++ b/toolkit/mozapps/extensions/moz.build
@@ -25,17 +25,16 @@ XPIDL_SOURCES += [
 XPIDL_MODULE = 'extensions'
 
 EXTRA_COMPONENTS += [
     'addonManager.js',
     'amContentHandler.js',
     'amInstallTrigger.js',
     'amWebAPI.js',
     'nsBlocklistService.js',
-    'nsBlocklistServiceContent.js',
 ]
 
 EXTRA_PP_COMPONENTS += [
     'extensions.manifest',
 ]
 
 EXTRA_JS_MODULES += [
     'AddonManager.jsm',
deleted file mode 100644
--- a/toolkit/mozapps/extensions/nsBlocklistServiceContent.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-const kMissingAPIMessage = "Unsupported blocklist call in the child process.";
-
-/*
- * A lightweight blocklist proxy for the content process that traps plugin
- * related blocklist checks and forwards them to the parent. This interface is
- * primarily designed to insure overlays work.. it does not control plugin
- * or addon loading.
- */
-
-function Blocklist() {
-  this.init();
-}
-
-Blocklist.prototype = {
-  classID: Components.ID("{e0a106ed-6ad4-47a4-b6af-2f1c8aa4712d}"),
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
-                                         Ci.nsIBlocklistService]),
-
-  init() {
-    Services.cpmm.addMessageListener("Blocklist:blocklistInvalidated", this);
-    Services.obs.addObserver(this, "xpcom-shutdown");
-  },
-
-  uninit() {
-    Services.cpmm.removeMessageListener("Blocklist:blocklistInvalidated", this);
-    Services.obs.removeObserver(this, "xpcom-shutdown");
-  },
-
-  observe(aSubject, aTopic, aData) {
-    switch (aTopic) {
-    case "xpcom-shutdown":
-      this.uninit();
-      break;
-    }
-  },
-
-  // Message manager message handlers
-  receiveMessage(aMsg) {
-    switch (aMsg.name) {
-      case "Blocklist:blocklistInvalidated":
-        Services.obs.notifyObservers(null, "blocklist-updated");
-        Services.cpmm.sendAsyncMessage("Blocklist:content-blocklist-updated");
-        break;
-      default:
-        throw new Error("Unknown blocklist message received from content: " + aMsg.name);
-    }
-  },
-
-  /*
-   * A helper that queries key data from a plugin or addon object
-   * and generates a simple data wrapper suitable for ipc. We hand
-   * these directly to the nsBlockListService in the parent which
-   * doesn't query for much.. allowing us to get away with this.
-   */
-  flattenObject(aTag) {
-    // Based on debugging the nsBlocklistService, these are the props the
-    // parent side will check on our objects.
-    let props = ["name", "description", "filename", "version"];
-    let dataWrapper = {};
-    for (let prop of props) {
-      dataWrapper[prop] = aTag[prop];
-    }
-    return dataWrapper;
-  },
-
-  // We support the addon methods here for completeness, but content currently
-  // only calls getPluginBlocklistState.
-
-  isAddonBlocklisted(aAddon, aAppVersion, aToolkitVersion) {
-    return true;
-  },
-
-  getAddonBlocklistState(aAddon, aAppVersion, aToolkitVersion) {
-    return Ci.nsIBlocklistService.STATE_BLOCKED;
-  },
-
-  get isLoaded() {
-    // Lie until we fix bug 1443870.
-    return true;
-  },
-
-  getPluginBlocklistState(aPluginTag, aAppVersion, aToolkitVersion) {
-    throw new Error(kMissingAPIMessage);
-  },
-
-  getAddonBlocklistURL(aAddon, aAppVersion, aToolkitVersion) {
-    throw new Error(kMissingAPIMessage);
-  },
-
-  getPluginBlocklistURL(aPluginTag) {
-    throw new Error(kMissingAPIMessage);
-  },
-
-  getPluginInfoURL(aPluginTag) {
-    throw new Error(kMissingAPIMessage);
-  }
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Blocklist]);