Backed out changeset 69866036d793 (bug 1076597) for being the wrong patch that landed.

This commit is contained in:
Ryan VanderMeulen 2014-10-21 10:12:56 -04:00
parent 4bc29fa367
commit 67e6833bd6

View File

@ -743,33 +743,20 @@ let SettingsRequestManager = {
}
},
removeMessageManager: function(aMsgMgr, aPrincipal) {
removeMessageManager: function(aMsgMgr){
if (DEBUG) debug("Removing message manager");
this.removeObserver(aMsgMgr);
let closedLockIDs = [];
let lockIDs = Object.keys(this.lockInfo);
for (let i in lockIDs) {
let lock = this.lockInfo[lockIDs[i]];
if (lock._mm == aMsgMgr) {
let is_finalizing = false;
for (let task_index in lock.tasks) {
if (lock.tasks[task_index].operation === "finalize") {
is_finalizing = true;
break;
}
}
if (!is_finalizing) {
this.queueTask("finalize", {lockID: lockIDs[i]}, aPrincipal).then(
function() {
if (DEBUG) debug("Lock " + lockIDs[i] + " with dead message manager finalized");
},
function(error) {
if (DEBUG) debug("Lock " + lockIDs[i] + " with dead message manager NOT FINALIZED due to error: " + error);
}
);
}
if (this.lockInfo[lockIDs[i]]._mm == aMsgMgr) {
if (DEBUG) debug("Removing lock " + lockIDs[i] + " due to process close/crash");
closedLockIDs.push(lockIDs[i]);
}
}
for (let i in closedLockIDs) {
this.removeLock(closedLockIDs[i]);
}
},
receiveMessage: function(aMessage) {
@ -825,7 +812,7 @@ let SettingsRequestManager = {
switch (aMessage.name) {
case "child-process-shutdown":
if (DEBUG) debug("Child process shutdown received.");
this.removeMessageManager(mm, aMessage.principal);
this.removeMessageManager(mm);
break;
case "Settings:RegisterForMessages":
if (!SettingsPermissions.hasSomeReadPermission(aMessage.principal)) {