mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Backed out changeset c0a9dd81198a (bug 1129040) for linux bc1 test failure on a CLOSED TREE
This commit is contained in:
parent
4142cabc3d
commit
ae58dbd5c0
@ -298,7 +298,7 @@ function Blocklist() {
|
||||
gPref.addObserver(PREF_EM_LOGGING_ENABLED, this, false);
|
||||
this.wrappedJSObject = this;
|
||||
// requests from child processes come in here, see receiveMessage.
|
||||
Services.ppmm.addMessageListener("Blocklist:getPluginBlocklistState", this);
|
||||
Services.ppmm.addMessageListener("Blocklist::getPluginBlocklistState", this);
|
||||
}
|
||||
|
||||
Blocklist.prototype = {
|
||||
@ -322,7 +322,7 @@ Blocklist.prototype = {
|
||||
|
||||
shutdown: function () {
|
||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||
Services.ppmm.removeMessageListener("Blocklist:getPluginBlocklistState", this);
|
||||
Services.ppmm.removeMessageListener("Blocklist::getPluginBlocklistState", this);
|
||||
gPref.removeObserver("extensions.blocklist.", this);
|
||||
gPref.removeObserver(PREF_EM_LOGGING_ENABLED, this);
|
||||
},
|
||||
@ -359,7 +359,7 @@ Blocklist.prototype = {
|
||||
// Message manager message handlers
|
||||
receiveMessage: function (aMsg) {
|
||||
switch (aMsg.name) {
|
||||
case "Blocklist:getPluginBlocklistState":
|
||||
case "Blocklist::getPluginBlocklistState":
|
||||
return this.getPluginBlocklistState(aMsg.data.addonData,
|
||||
aMsg.data.appVersion,
|
||||
aMsg.data.toolkitVersion);
|
||||
@ -1192,11 +1192,6 @@ Blocklist.prototype = {
|
||||
return blockEntry.infoURL;
|
||||
},
|
||||
|
||||
_notifyObserversBlocklistUpdated: function () {
|
||||
Services.obs.notifyObservers(this, "blocklist-updated", "");
|
||||
Services.ppmm.broadcastAsyncMessage("Blocklist:blocklistInvalidated", {});
|
||||
},
|
||||
|
||||
_blocklistUpdated: function Blocklist_blocklistUpdated(oldAddonEntries, oldPluginEntries) {
|
||||
var addonList = [];
|
||||
|
||||
@ -1301,7 +1296,7 @@ Blocklist.prototype = {
|
||||
}
|
||||
|
||||
if (addonList.length == 0) {
|
||||
self._notifyObserversBlocklistUpdated();
|
||||
Services.obs.notifyObservers(self, "blocklist-updated", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1313,7 +1308,7 @@ Blocklist.prototype = {
|
||||
} catch (e) {
|
||||
LOG(e);
|
||||
}
|
||||
self._notifyObserversBlocklistUpdated();
|
||||
Services.obs.notifyObservers(self, "blocklist-updated", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1347,7 +1342,7 @@ Blocklist.prototype = {
|
||||
if (args.restart)
|
||||
restartApp();
|
||||
|
||||
self._notifyObserversBlocklistUpdated();
|
||||
Services.obs.notifyObservers(self, "blocklist-updated", "");
|
||||
Services.obs.removeObserver(applyBlocklistChanges, "addon-blocklist-closed");
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@ const kMissingAPIMessage = "Unsupported blocklist call in the child process."
|
||||
*/
|
||||
|
||||
function Blocklist() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
Blocklist.prototype = {
|
||||
@ -29,41 +28,12 @@ Blocklist.prototype = {
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBlocklistService]),
|
||||
|
||||
init: function () {
|
||||
Services.cpmm.addMessageListener("Blocklist:blocklistInvalidated", this);
|
||||
Services.obs.addObserver(this, "xpcom-shutdown", false);
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
Services.cpmm.removeMessageListener("Blocklist:blocklistInvalidated", this);
|
||||
Services.obs.removeObserver(this, "xpcom-shutdown", false);
|
||||
},
|
||||
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "xpcom-shutdown":
|
||||
this.uninit();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// Message manager message handlers
|
||||
receiveMessage: function (aMsg) {
|
||||
switch (aMsg.name) {
|
||||
case "Blocklist:blocklistInvalidated":
|
||||
Services.obs.notifyObservers(null, "blocklist-updated", null);
|
||||
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.
|
||||
*/
|
||||
* 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: function (aTag) {
|
||||
// Based on debugging the nsBlocklistService, these are the props the
|
||||
// parent side will check on our objects.
|
||||
@ -87,7 +57,7 @@ Blocklist.prototype = {
|
||||
},
|
||||
|
||||
getPluginBlocklistState: function (aPluginTag, aAppVersion, aToolkitVersion) {
|
||||
return Services.cpmm.sendSyncMessage("Blocklist:getPluginBlocklistState", {
|
||||
return Services.cpmm.sendSyncMessage("Blocklist::getPluginBlocklistState", {
|
||||
addonData: this.flattenObject(aPluginTag),
|
||||
appVersion: aAppVersion,
|
||||
toolkitVersion: aToolkitVersion
|
||||
|
Loading…
Reference in New Issue
Block a user