[Pkg-mozext-commits] [greasemonkey] 22/43: Fix messageManagerForWin() when E10S is disabled.

David Prévot taffit at moszumanska.debian.org
Sun Feb 22 21:56:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit fbb8249ef91d2a89c6e46b03635149b720cc1c9f
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Wed Nov 19 16:06:32 2014 -0500

    Fix messageManagerForWin() when E10S is disabled.
---
 modules/util/messageManagerForWin.js | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/modules/util/messageManagerForWin.js b/modules/util/messageManagerForWin.js
index 3033f22..7d2f523 100644
--- a/modules/util/messageManagerForWin.js
+++ b/modules/util/messageManagerForWin.js
@@ -3,19 +3,25 @@ var EXPORTED_SYMBOLS = ['messageManagerForWin'];
 var Ci = Components.interfaces;
 
 function messageManagerForWin(aContentWin) {
-  var rti = aContentWin.QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIWebNavigation)
-      .QueryInterface(Ci.nsIDocShellTreeItem)
-      .rootTreeItem;
-
-  // dump(rti + "\n");
-  // dump(rti.itemType + "\n");
-  // dump(rti.name + "\n");
-
-  return aContentWin.QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIWebNavigation)
-      .QueryInterface(Ci.nsIDocShellTreeItem)
-      .rootTreeItem
-      .QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIContentFrameMessageManager);
+  try {
+    // This crazy incantation works only when E10S is ENabled.
+    return aContentWin.QueryInterface(Ci.nsIInterfaceRequestor)
+        .getInterface(Ci.nsIWebNavigation)
+        .QueryInterface(Ci.nsIDocShellTreeItem)
+        .rootTreeItem
+        .QueryInterface(Ci.nsIInterfaceRequestor)
+        .getInterface(Ci.nsIContentFrameMessageManager);
+  } catch (e) {
+    // While this one works when E10S is DISabled.
+    try {
+      return aContentWin.QueryInterface(Ci.nsIInterfaceRequestor)
+          .getInterface(Ci.nsIWebNavigation)
+          .QueryInterface(Ci.nsIDocShell)
+          .QueryInterface(Ci.nsIInterfaceRequestor)
+          .getInterface(Ci.nsIContentFrameMessageManager);
+    } catch (e) {
+      dump('Could not get message manager round 2:\n'+e+'\n\n');
+      return null;
+    }
+  }
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list