Bug 1064800 - Catch exception from sending message to prevent interrupting execution. r=khuey
authorTing-Yu Chou <janus926@gmail.com>
Thu, 02 Oct 2014 10:57:48 +0800
changeset 231570 34519185fe24c2e637870cf4ec9dbd769a38317e
parent 231569 c3fc41feeb22acb7f36c38ff8985c6767dfcaa83
child 231571 fb0d1cc20298a9827fd373359e9ce1aa08e60d23
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1064800
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1064800 - Catch exception from sending message to prevent interrupting execution. r=khuey
dom/settings/SettingsRequestManager.jsm
--- a/dom/settings/SettingsRequestManager.jsm
+++ b/dom/settings/SettingsRequestManager.jsm
@@ -678,17 +678,21 @@ let SettingsRequestManager = {
   broadcastMessage: function broadcastMessage(aMsgName, aContent) {
     if (DEBUG) debug("Broadcast");
     this.children.forEach(function(msgMgr) {
       let principal = this.mmPrincipals.get(msgMgr);
       if (!principal) {
         if (DEBUG) debug("Cannot find principal for message manager to check permissions");
       }
       else if (SettingsPermissions.hasReadPermission(principal, aContent.key)) {
-        msgMgr.sendAsyncMessage(aMsgName, aContent);
+        try {
+          msgMgr.sendAsyncMessage(aMsgName, aContent);
+        } catch (e) {
+          if (DEBUG) debug("Failed sending message: " + aMsgName);
+        }
       }
     }.bind(this));
     if (DEBUG) debug("Finished Broadcasting");
   },
 
   addObserver: function(aMsgMgr, aPrincipal) {
     if (DEBUG) debug("Add observer for " + aPrincipal.origin);
     if (this.children.indexOf(aMsgMgr) == -1) {