Bug 1472212 - Handle navigation away from privileged content process in RDM. r=jryans
☠☠ backed out by 9a4b8f268757 ☠ ☠
authorJay Lim <jlim@mozilla.com>
Fri, 20 Jul 2018 18:40:44 -0400
changeset 440855 55c2a8d227dc91f965718aa09da9811cff0969a7
parent 440854 a8bba29ad2cb20239b87081f77cdf34249d3337b
child 440856 a28443371b944ee00b1267dd5b9a22da6d28353b
push id108875
push usermconley@mozilla.com
push dateFri, 12 Oct 2018 15:25:33 +0000
treeherdermozilla-inbound@78a9a2adf32a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1472212
milestone64.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.