Bug 1312880 - Remove sync message when starting up RemoteAddonsChild. r?billm
MozReview-Commit-ID: LHNXZOphynk
--- 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)