Bug 1472212 - Handle navigation away from privileged content process in RDM. r=jryans
☠☠ backed out by fc21376e28da ☠ ☠
authorJay Lim <jlim@mozilla.com>
Fri, 20 Jul 2018 18:40:44 -0400
changeset 443393 f8a06d01437e
parent 443392 b6996abc7d90
child 443394 ebdca743668c
push id34955
push userrgurzau@mozilla.com
push dateMon, 29 Oct 2018 22:01:36 +0000
treeherdermozilla-central@4c7772c170a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1472212
milestone65.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 1472212 - Handle navigation away from privileged content process in RDM. r=jryans Author: J. Ryan Stinnett <jryans@gmail.com> Now that we are running about:home in the privileged content process, clicking on a link in Activity Stream while having RDM activated will close the RDM because a process flip will occur. This causes the following tests to time out because the RDM has been deactivated: - devtools/client/responsive.html/test/browser/browser_container_tab.js - devtools/client/responsive.html/test/browser/browser_preloaded_newtab.js This patch disables RDM in about:home and will load about:blank instead when RDM is enabled. MozReview-Commit-ID: D5EMyfkOM8l
devtools/client/responsive.html/browser/swap.js
--- a/devtools/client/responsive.html/browser/swap.js
+++ b/devtools/client/responsive.html/browser/swap.js
@@ -101,30 +101,42 @@ function swapToInnerBrowser({ tab, conta
       browser.loadURI(uri, options);
     });
   }
 
   return {
 
     async start() {
       // In some cases, such as a preloaded browser used for about:newtab, browser code
-      // will force a new frameloader on next navigation to ensure balanced process
-      // assignment.  If this case will happen here, navigate to about:blank first to get
-      // this out of way so that we stay within one process while RDM is open.
-      const { newFrameloader } = E10SUtils.shouldLoadURIInBrowser(
-        tab.linkedBrowser,
-        "about:blank"
+      // will force a new frameloader on next navigation to remote content to ensure
+      // balanced process assignment.  If this case will happen here, navigate to
+      // about:blank first to get this out of way so that we stay within one process while
+      // RDM is open. Some process selection rules are specific to remote content, so we
+      // use `http://example.com` as a test for what a remote navigation would cause.
+      const {
+        requiredRemoteType,
+        mustChangeProcess,
+        newFrameloader,
+      } = E10SUtils.shouldLoadURIInBrowser(
+         tab.linkedBrowser,
+        "http://example.com"
       );
       if (newFrameloader) {
         debug(`Tab will force a new frameloader on navigation, load about:blank first`);
         await loadURIWithNewFrameLoader(tab.linkedBrowser, "about:blank", {
           flags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
           triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
         });
       }
+      if (mustChangeProcess) {
+        debug(`Tab will force a process flip on navigation, load about:blank first`);
+        gBrowser.updateBrowserRemoteness(tab.linkedBrowser, true, {
+          remoteType: requiredRemoteType,
+        });
+      }
 
       tab.isResponsiveDesignMode = true;
 
       // Hide the browser content temporarily while things move around to avoid displaying
       // strange intermediate states.
       tab.linkedBrowser.style.visibility = "hidden";
 
       // Freeze navigation temporarily to avoid "blinking" in the location bar.