tabbrowser swap debugging draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 19 Apr 2016 16:35:12 -0500
changeset 375850 23bf52e94e9beaab8aad1539c55b3812c46c5899
parent 375849 85148063a5e019e987a1620d38b2aa1c2a1ebb9b
child 375851 ee7e0420e6f75cd28d54b20ba91bfaa82d8c4303
push id20402
push userbmo:jryans@gmail.com
push dateMon, 06 Jun 2016 20:31:20 +0000
milestone49.0a1
tabbrowser swap debugging MozReview-Commit-ID: IKBu3ud6Fii
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2569,28 +2569,34 @@
         </body>
       </method>
 
       <method name="swapBrowsersAndCloseOther">
         <parameter name="aOurTab"/>
         <parameter name="aOtherTab"/>
         <body>
           <![CDATA[
+            dump("Enter swapBrowsersAndCloseOther\n");
+
             // Do not allow transfering a private tab to a non-private window
             // and vice versa.
             if (PrivateBrowsingUtils.isWindowPrivate(window) !=
-                PrivateBrowsingUtils.isWindowPrivate(aOtherTab.ownerDocument.defaultView))
+                PrivateBrowsingUtils.isWindowPrivate(aOtherTab.ownerDocument.defaultView)) {
+              dump("Private browsing mismatch\n");
               return;
+            }
 
             let ourBrowser = this.getBrowserForTab(aOurTab);
             let otherBrowser = aOtherTab.linkedBrowser;
 
             // Can't swap between chrome and content processes.
-            if (ourBrowser.isRemoteBrowser != otherBrowser.isRemoteBrowser)
+            if (ourBrowser.isRemoteBrowser != otherBrowser.isRemoteBrowser) {
+              dump("Remoteness mismatch\n");
               return;
+            }
 
             // Keep the userContextId if set on other browser
             if (otherBrowser.hasAttribute("usercontextid")) {
               ourBrowser.setAttribute("usercontextid", otherBrowser.getAttribute("usercontextid"));
             }
 
             // That's gBrowser for the other window, not the tab's browser!
             var remoteBrowser = aOtherTab.ownerDocument.defaultView.gBrowser;