Bug 1312880 - Remove sync message when starting up RemoteAddonsChild. r=billm
authorMike Conley <mconley@mozilla.com>
Fri, 28 Oct 2016 10:16:00 -0400
changeset 320105 8b1ef926af1c77f31dd32f5112e04b9a00a098d1
parent 320104 5abb9719039409324fb8dbc7a32e184c5f1f39cb
child 320106 75db19443bc054c4babd9567f837c2618947cc6c
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1312880
milestone52.0a1
Bug 1312880 - Remove sync message when starting up RemoteAddonsChild. r=billm MozReview-Commit-ID: LHNXZOphynk
toolkit/components/addoncompat/RemoteAddonsChild.jsm
toolkit/components/addoncompat/RemoteAddonsParent.jsm
--- a/toolkit/components/addoncompat/RemoteAddonsChild.jsm
+++ b/toolkit/components/addoncompat/RemoteAddonsChild.jsm
@@ -44,18 +44,17 @@ function setDefault(dict, key, default_)
 //
 // In the child, clients can watch for changes to all paths that start
 // with a given component.
 var NotificationTracker = {
   init: function() {
     let cpmm = Cc["@mozilla.org/childprocessmessagemanager;1"]
                .getService(Ci.nsISyncMessageSender);
     cpmm.addMessageListener("Addons:ChangeNotification", this);
-    let [paths] = cpmm.sendSyncMessage("Addons:GetNotifications");
-    this._paths = paths;
+    this._paths = cpmm.initialProcessData.remoteAddonsNotificationPaths;
     this._registered = new Map();
     this._watchers = {};
   },
 
   receiveMessage: function(msg) {
     let path = msg.data.path;
     let count = msg.data.count;
 
--- a/toolkit/components/addoncompat/RemoteAddonsParent.jsm
+++ b/toolkit/components/addoncompat/RemoteAddonsParent.jsm
@@ -48,17 +48,17 @@ var NotificationTracker = {
   // Each component in a path will be a key in some dictionary. At the
   // end, the _count property keeps track of how many instances of the
   // given path are present in _paths.
   _paths: {},
 
   init: function() {
     let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"]
                .getService(Ci.nsIMessageBroadcaster);
-    ppmm.addMessageListener("Addons:GetNotifications", this);
+    ppmm.initialProcessData.remoteAddonsNotificationPaths = this._paths;
   },
 
   add: function(path) {
     let tracked = this._paths;
     for (let component of path) {
       tracked = setDefault(tracked, component, {});
     }
     let count = tracked._count || 0;
@@ -76,23 +76,16 @@ var NotificationTracker = {
       tracked = setDefault(tracked, component, {});
     }
     tracked._count--;
 
     let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"]
                .getService(Ci.nsIMessageBroadcaster);
     ppmm.broadcastAsyncMessage("Addons:ChangeNotification", {path: path, count: tracked._count});
   },
-
-  receiveMessage: function(msg) {
-    if (msg.name == "Addons:GetNotifications") {
-      return this._paths;
-    }
-    return undefined;
-  }
 };
 NotificationTracker.init();
 
 // An interposition is an object with three properties: methods,
 // getters, and setters. See multiprocessShims.js for an explanation
 // of how these are used. The constructor here just allows one
 // interposition to inherit members from another.
 function Interposition(name, base)