From 67e6833bd63e3171ce1599728ef514d751b3a080 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Tue, 21 Oct 2014 10:12:56 -0400 Subject: [PATCH] Backed out changeset 69866036d793 (bug 1076597) for being the wrong patch that landed. --- dom/settings/SettingsRequestManager.jsm | 29 +++++++------------------ 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/dom/settings/SettingsRequestManager.jsm b/dom/settings/SettingsRequestManager.jsm index 9ffcece82edb..21e7ac2028ba 100644 --- a/dom/settings/SettingsRequestManager.jsm +++ b/dom/settings/SettingsRequestManager.jsm @@ -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)) {