Bug 1172137 - Update outerWindowID after a browser's remoteness changed. r=mconley, a=lizzard
authorTim Taubert <ttaubert@mozilla.com>
Tue, 09 Jun 2015 08:59:44 +0200
changeset 266239 73d2a857261f
parent 266238 5ac2c3ff9a6d
child 266240 71ce4845c6f6
push id4796
push userryanvm@gmail.com
push date2015-06-11 16:30 +0000
treeherdermozilla-beta@ad1f0e1ddaf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, lizzard
bugs1172137
milestone39.0
Bug 1172137 - Update outerWindowID after a browser's remoteness changed. r=mconley, a=lizzard
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1488,16 +1488,19 @@
         <body>
           <![CDATA[
             let isRemote = aBrowser.getAttribute("remote") == "true";
             if (isRemote == aShouldBeRemote)
               return false;
 
             let wasActive = document.activeElement == aBrowser;
 
+            // Unmap the old outerWindowID.
+            this._outerWindowIDBrowserMap.delete(aBrowser.outerWindowID);
+
             // Unhook our progress listener.
             let tab = this.getTabForBrowser(aBrowser);
             let index = tab._tPos;
             let filter = this.mTabFilters[index];
             aBrowser.webProgress.removeProgressListener(filter);
             // Make sure the browser is destroyed so it unregisters from observer notifications
             aBrowser.destroy();
 
@@ -1518,16 +1521,19 @@
               tab.setAttribute("remote", "true");
               // Switching the browser to be remote will connect to a new child
               // process so the browser can no longer be considered to be
               // crashed.
               tab.removeAttribute("crashed");
             } else {
               tab.removeAttribute("remote");
               aBrowser.messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: tab.pinned })
+
+              // Register the new outerWindowID.
+              this._outerWindowIDBrowserMap.set(aBrowser.outerWindowID, aBrowser);
             }
 
             if (wasActive)
               aBrowser.focus();
 
             let evt = document.createEvent("Events");
             evt.initEvent("TabRemotenessChange", true, false);
             tab.dispatchEvent(evt);