Bug 1369345 - Remove messageWakeupService, r=nalexander.
authorFlorian Quèze <florian@queze.net>
Fri, 02 Jun 2017 22:54:46 +0200
changeset 412648 55366075a57e593a5218c35ef13570ac6d978e24
parent 412647 8aee9eb0b3495ec3aa3ee4894cd52a7ebaf9896b
child 412649 6e538d5add9adf7af315b8fede3c695d23491663
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1369345
milestone55.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 1369345 - Remove messageWakeupService, r=nalexander.
browser/installer/package-manifest.in
dom/base/messageWakeupService.js
dom/base/messageWakeupService.manifest
dom/base/moz.build
mobile/android/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -506,18 +506,16 @@
 @RESPATH@/components/CaptivePortalDetectComponents.manifest
 @RESPATH@/components/captivedetect.js
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/cryptoComponents.manifest
 @RESPATH@/components/TelemetryStartup.js
 @RESPATH@/components/TelemetryStartup.manifest
 @RESPATH@/components/XULStore.js
 @RESPATH@/components/XULStore.manifest
-@RESPATH@/components/messageWakeupService.js
-@RESPATH@/components/messageWakeupService.manifest
 @RESPATH@/components/recording-cmdline.js
 @RESPATH@/components/recording-cmdline.manifest
 @RESPATH@/components/htmlMenuBuilder.js
 @RESPATH@/components/htmlMenuBuilder.manifest
 
 @RESPATH@/components/NotificationStorage.js
 @RESPATH@/components/NotificationStorage.manifest
 @RESPATH@/components/Push.js
deleted file mode 100644
--- a/dom/base/messageWakeupService.js
+++ /dev/null
@@ -1,96 +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/. */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-const CATEGORY_WAKEUP_REQUEST = "wakeup-request";
-
-function MessageWakeupService() { };
-
-MessageWakeupService.prototype =
-{
-  classID:          Components.ID("{f9798742-4f7b-4188-86ba-48b116412b29}"),
-  QueryInterface:   XPCOMUtils.generateQI([Ci.nsIObserver]),
-
-  messagesData: [],
-
-  get messageManager() {
-    if (!this._messageManager)
-      this._messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"].
-                             getService(Ci.nsIMessageListenerManager);
-    return this._messageManager;
-  },
-
-  requestWakeup: function(aMessageName, aCid, aIid, aMethod) {
-    this.messagesData[aMessageName] = {
-      cid: aCid,
-      iid: aIid,
-      method: aMethod,
-    };
-
-    this.messageManager.addMessageListener(aMessageName, this);
-  },
-
-  receiveMessage: function(aMessage) {
-    let data = this.messagesData[aMessage.name];
-    // TODO: When bug 593407 is ready, stop doing the wrappedJSObject hack
-    //       and use this line instead:
-    //                  QueryInterface(Ci.nsIMessageListener);
-    let service = Cc[data.cid][data.method](Ci[data.iid]).
-                  wrappedJSObject;
-
-    // The receiveMessage() call itself may spin an event loop, and we
-    // do not want to swap listeners in that - it would cause the current
-    // message to be answered by two listeners. So, we call that first,
-    // then queue the swap for the next event loop
-    let ret = service.receiveMessage(aMessage);
-
-    if (data.timer) {
-      // Handle the case of two such messages happening in quick succession
-      data.timer.cancel();
-      data.timer = null;
-    }
-
-    data.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-    let self = this;
-    data.timer.initWithCallback(function() {
-      self.messageManager.addMessageListener(aMessage.name, service);
-      self.messageManager.removeMessageListener(aMessage.name, self);
-      delete self.messagesData[aMessage.name];
-    }, 0, Ci.nsITimer.TYPE_ONE_SHOT);
-
-    return ret;
-  },
-
-  observe: function TM_observe(aSubject, aTopic, aData) {
-    switch (aTopic) {
-      case "profile-after-change":
-        {
-          var catMan = Cc["@mozilla.org/categorymanager;1"].
-                           getService(Ci.nsICategoryManager);
-          var entries = catMan.enumerateCategory(CATEGORY_WAKEUP_REQUEST);
-          while (entries.hasMoreElements()) {
-            var entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
-            var value = catMan.getCategoryEntry(CATEGORY_WAKEUP_REQUEST, entry);
-            var parts = value.split(",");
-            var cid = parts[0];
-            var iid = parts[1];
-            var method = parts[2];
-            var messages = parts.slice(3);
-            messages.forEach(function(messageName) {
-              this.requestWakeup(messageName, cid, iid, method);
-            }, this);
-          }
-        }
-        break;
-    }
-  },
-};
-
-var components = [MessageWakeupService];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
-
deleted file mode 100644
--- a/dom/base/messageWakeupService.manifest
+++ /dev/null
@@ -1,4 +0,0 @@
-component {f9798742-4f7b-4188-86ba-48b116412b29} messageWakeupService.js
-contract @mozilla.org/content/messagewakeupservice;1 {f9798742-4f7b-4188-86ba-48b116412b29}
-category profile-after-change messageWakeupService @mozilla.org/content/messagewakeupservice;1
-
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -398,18 +398,16 @@ SOURCES += [
 # nsTextFragment.cpp
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['nsTextFragmentSSE2.cpp']
     SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
 EXTRA_COMPONENTS += [
     'contentAreaDropListener.js',
     'contentAreaDropListener.manifest',
-    'messageWakeupService.js',
-    'messageWakeupService.manifest',
     'ProcessSelector.js',
     'ProcessSelector.manifest',
     'SlowScriptDebug.js',
     'SlowScriptDebug.manifest',
 ]
 
 EXTRA_JS_MODULES += [
     'DOMRequestHelper.jsm',
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -346,18 +346,16 @@
 @BINPATH@/components/nsWebHandlerApp.manifest
 @BINPATH@/components/nsWebHandlerApp.js
 @BINPATH@/components/satchel.manifest
 @BINPATH@/components/nsFormAutoComplete.js
 @BINPATH@/components/FormHistoryStartup.js
 @BINPATH@/components/nsInputListAutoComplete.js
 @BINPATH@/components/contentAreaDropListener.manifest
 @BINPATH@/components/contentAreaDropListener.js
-@BINPATH@/components/messageWakeupService.js
-@BINPATH@/components/messageWakeupService.manifest
 @BINPATH@/components/nsINIProcessor.manifest
 @BINPATH@/components/nsINIProcessor.js
 @BINPATH@/components/servicesComponents.manifest
 
 #ifndef MOZ_GECKOVIEW_JAR
 @BINPATH@/components/TelemetryStartup.js
 @BINPATH@/components/TelemetryStartup.manifest
 #endif