Bug 1524709 - Remove aShouldBeRemote from updateBrowserRemoteness; r=nika
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 14 Mar 2019 00:51:30 +0000
changeset 521807 0eb7cd7c505a9617663ee8877a92bfab0a108f0d
parent 521806 de231288332bdff9e8443dc6a28befbd9b3b5a26
child 521808 5849b867ecf7c485b71ca694167f5a63b2d6c6ca
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1524709
milestone67.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 1524709 - Remove aShouldBeRemote from updateBrowserRemoteness; r=nika Just set the RemoteType in the options object argument, instead of doubling up the information. Differential Revision: https://phabricator.services.mozilla.com/D23250
browser/base/content/browser.js
browser/base/content/tabbrowser.js
browser/base/content/utilityOverlay.js
browser/components/sessionstore/SessionStore.jsm
browser/components/sessionstore/test/browser_remoteness_flip_on_restore.js
browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js
browser/modules/ContentCrashHandlers.jsm
devtools/client/responsive.html/browser/swap.js
devtools/client/webreplay/menu.js
dom/base/test/browser_messagemanager_loadprocessscript.js
testing/talos/talos/pageloader/chrome/pageloader.js
toolkit/components/viewsource/ViewSourceBrowser.jsm
toolkit/content/tests/browser/browser_crash_previous_frameloader.js
toolkit/content/tests/browser/browser_findbar.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3392,18 +3392,19 @@ function BrowserReloadWithFlags(reloadFl
         tab.addEventListener("SSTabRestoring",
                              () => loadBrowserURI(browser, url),
                              { once: true });
         gBrowser._insertBrowser(tab);
       }
     } else if (browser.hasAttribute("recordExecution")) {
       // Recording tabs always use new content processes when reloading, to get
       // a fresh recording.
-      gBrowser.updateBrowserRemoteness(browser, true,
-                                       { recordExecution: "*", newFrameloader: true });
+      gBrowser.updateBrowserRemoteness(browser,
+                                       { recordExecution: "*", newFrameloader: true,
+                                         remoteType: E10SUtils.DEFAULT_REMOTE_TYPE });
       loadBrowserURI(browser, url);
     } else {
       unchangedRemoteness.push(tab);
     }
   }
 
   if (unchangedRemoteness.length == 0) {
     return;
@@ -4751,17 +4752,18 @@ var XULBrowserWindow = {
     delete this._elementsForViewSource;
     return this._elementsForViewSource = [
       document.getElementById("context-viewsource"),
       document.getElementById("View:PageSource"),
     ];
   },
 
   forceInitialBrowserNonRemote(aOpener) {
-    gBrowser.updateBrowserRemoteness(gBrowser.initialBrowser, false, { opener: aOpener });
+    gBrowser.updateBrowserRemoteness(gBrowser.initialBrowser, { opener: aOpener,
+                                                                remoteType: E10SUtils.NOT_REMOTE });
   },
 
   setDefaultStatus(status) {
     this.defaultStatus = status;
     StatusPanel.update();
   },
 
   setOverLink(url, anchorElt) {
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -54,16 +54,20 @@ window._gBrowser = {
     messageManager.addMessageListener("RefreshBlocker:Blocked", this);
     messageManager.addMessageListener("Browser:WindowCreated", this);
 
     // To correctly handle keypresses for potential FindAsYouType, while
     // the tab's find bar is not yet initialized.
     messageManager.addMessageListener("Findbar:Keypress", this);
     this._setFindbarData();
 
+    XPCOMUtils.defineLazyModuleGetters(this, {
+      E10SUtils: "resource://gre/modules/E10SUtils.jsm",
+    });
+
     XPCOMUtils.defineLazyPreferenceGetter(this, "animationsEnabled",
       "toolkit.cosmeticAnimations.enabled");
 
     this._setupEventListeners();
   },
 
   ownerGlobal: window,
 
@@ -1594,50 +1598,54 @@ window._gBrowser = {
       this.addTab(aURIs[i], params);
     }
 
     if (firstTabAdded && !inBackground) {
       this.selectedTab = firstTabAdded;
     }
   },
 
-  updateBrowserRemoteness(aBrowser, aShouldBeRemote, {
+  updateBrowserRemoteness(aBrowser, {
     newFrameloader,
     opener,
     remoteType,
     sameProcessAsFrameLoader,
     recordExecution,
   } = {}) {
     let isRemote = aBrowser.getAttribute("remote") == "true";
 
-    if (!gMultiProcessBrowser && aShouldBeRemote) {
+    // We have to be careful with this here, as the "no remote type" is null,
+    // not a string. Make sure to check only for undefined, since null is
+    // allowed.
+    if (remoteType === undefined) {
+      throw new Error("Remote type must be set!");
+    }
+
+    let shouldBeRemote = remoteType !== E10SUtils.NOT_REMOTE;
+
+    if (!gMultiProcessBrowser && shouldBeRemote) {
       throw new Error("Cannot switch to remote browser in a window " +
         "without the remote tabs load context.");
     }
 
-    // Default values for remoteType
-    if (!remoteType) {
-      remoteType = aShouldBeRemote ? E10SUtils.DEFAULT_REMOTE_TYPE : E10SUtils.NOT_REMOTE;
-    }
-
     // If we are passed an opener, we must be making the browser non-remote, and
     // if the browser is _currently_ non-remote, we need the openers to match,
     // because it is already too late to change it.
     if (opener) {
-      if (aShouldBeRemote) {
+      if (shouldBeRemote) {
         throw new Error("Cannot set an opener on a browser which should be remote!");
       }
       if (!isRemote && aBrowser.contentWindow.opener != opener) {
         throw new Error("Cannot change opener on an already non-remote browser!");
       }
     }
 
     // Abort if we're not going to change anything
     let oldRemoteType = aBrowser.remoteType;
-    if (isRemote == aShouldBeRemote && !newFrameloader &&
+    if (isRemote == shouldBeRemote && !newFrameloader &&
         (!isRemote || oldRemoteType == remoteType)) {
       return false;
     }
 
     let tab = this.getTabForBrowser(aBrowser);
     // aBrowser needs to be inserted now if it hasn't been already.
     this._insertBrowser(tab);
 
@@ -1665,17 +1673,17 @@ window._gBrowser = {
     let hadStartedLoad = aBrowser.didStartLoadSinceLastUserTyping();
 
     // Make sure the browser is destroyed so it unregisters from observer notifications
     aBrowser.destroy();
 
     // Change the "remote" attribute.
     let parent = aBrowser.parentNode;
     aBrowser.remove();
-    if (aShouldBeRemote) {
+    if (shouldBeRemote) {
       aBrowser.setAttribute("remote", "true");
       aBrowser.setAttribute("remoteType", remoteType);
     } else {
       aBrowser.setAttribute("remote", "false");
       aBrowser.removeAttribute("remoteType");
     }
 
     if (recordExecution) {
@@ -1688,17 +1696,17 @@ window._gBrowser = {
       aBrowser.removeAttribute("recordExecution");
     }
 
     // NB: This works with the hack in the browser constructor that
     // turns this normal property into a field.
     if (sameProcessAsFrameLoader) {
       // Always set sameProcessAsFrameLoader when passed in explicitly.
       aBrowser.sameProcessAsFrameLoader = sameProcessAsFrameLoader;
-    } else if (!aShouldBeRemote || oldRemoteType == remoteType) {
+    } else if (!shouldBeRemote || oldRemoteType == remoteType) {
       // Only copy existing sameProcessAsFrameLoader when not switching
       // remote type otherwise it would stop the switch.
       aBrowser.sameProcessAsFrameLoader = oldSameProcessAsFrameLoader;
     }
 
     if (opener) {
       // Set the opener window on the browser, such that when the frame
       // loader is created the opener is set correctly.
@@ -1739,17 +1747,17 @@ window._gBrowser = {
                                 true, false);
     let event = securityUI ? securityUI.contentBlockingEvent : 0;
     // Include the true final argument to indicate that this event is
     // simulated (instead of being observed by the webProgressListener).
     this._callProgressListeners(aBrowser, "onContentBlockingEvent",
                                 [aBrowser.webProgress, null, event, true],
                                 true, false);
 
-    if (aShouldBeRemote) {
+    if (shouldBeRemote) {
       // 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 {
       aBrowser.messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: tab.pinned });
 
       // Register the new outerWindowID.
@@ -1771,33 +1779,33 @@ window._gBrowser = {
     evt = document.createEvent("Events");
     evt.initEvent("TabRemotenessChange", true, false);
     tab.dispatchEvent(evt);
 
     return true;
   },
 
   updateBrowserRemotenessByURL(aBrowser, aURL, aOptions = {}) {
-    if (!gMultiProcessBrowser)
-      return this.updateBrowserRemoteness(aBrowser, false);
+    if (!gMultiProcessBrowser) {
+      return this.updateBrowserRemoteness(aBrowser, { remoteType: E10SUtils.NOT_REMOTE });
+    }
 
     let oldRemoteType = aBrowser.remoteType;
 
     aOptions.remoteType =
       E10SUtils.getRemoteTypeForURI(aURL,
         gMultiProcessBrowser,
         oldRemoteType,
         aBrowser.currentURI);
 
     // If this URL can't load in the current browser then flip it to the
     // correct type.
     if (oldRemoteType != aOptions.remoteType ||
         aOptions.newFrameloader) {
-      let remote = aOptions.remoteType != E10SUtils.NOT_REMOTE;
-      return this.updateBrowserRemoteness(aBrowser, remote, aOptions);
+      return this.updateBrowserRemoteness(aBrowser, aOptions);
     }
 
     return false;
   },
 
   removePreloadedBrowser() {
     if (!this._isPreloadingEnabled()) {
       return;
@@ -4702,17 +4710,17 @@ window._gBrowser = {
       }
 
       let icon = browser.mIconURL;
       let tab = this.getTabForBrowser(browser);
 
       if (this.selectedBrowser == browser) {
         TabCrashHandler.onSelectedBrowserCrash(browser, false);
       } else {
-        this.updateBrowserRemoteness(browser, false);
+        this.updateBrowserRemoteness(browser, { remoteType: E10SUtils.NOT_REMOTE });
         SessionStore.reviveCrashedTab(tab);
       }
 
       tab.removeAttribute("soundplaying");
       this.setIcon(tab, icon);
     });
 
     this.addEventListener("oop-browser-buildid-mismatch", (event) => {
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -548,18 +548,19 @@ function openLinkIn(url, where, params) 
       // force the about:blank viewer to have the right principal:
       targetBrowser.createAboutBlankContentViewer(aPrincipal);
     }
 
     // When navigating a recording tab, use a new content process in order to
     // start a new recording.
     if (targetBrowser.hasAttribute("recordExecution") &&
         targetBrowser.currentURI.spec != "about:blank") {
-      w.gBrowser.updateBrowserRemoteness(targetBrowser, true,
-                                         { recordExecution: "*", newFrameloader: true });
+      w.gBrowser.updateBrowserRemoteness(targetBrowser,
+                                         { recordExecution: "*", newFrameloader: true,
+                                           remoteType: E10SUtils.DEFAULT_REMOTE_TYPE });
     }
 
     let ReferrerInfo = Components.Constructor("@mozilla.org/referrer-info;1",
                                               "nsIReferrerInfo",
                                               "init");
     targetBrowser.loadURI(url, {
       triggeringPrincipal: aTriggeringPrincipal,
       csp: aCsp,
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -3678,17 +3678,17 @@ var SessionStoreInternal = {
       if (select &&
           tabbrowser.selectedTab.userContextId == userContextId) {
         tab = tabbrowser.selectedTab;
         if (!tabData.pinned) {
           tabbrowser.unpinTab(tab);
         }
         tabbrowser.moveTabToEnd();
         if (aWindow.gMultiProcessBrowser && !tab.linkedBrowser.isRemoteBrowser) {
-          tabbrowser.updateBrowserRemoteness(tab.linkedBrowser, true);
+          tabbrowser.updateBrowserRemoteness(tab.linkedBrowser, { remoteType: E10SUtils.DEFAULT_REMOTE_TYPE });
         }
       }
 
       // Add a new tab if needed.
       if (!tab) {
         let createLazyBrowser = restoreTabsLazily && !select && !tabData.pinned;
 
         let url = "about:blank";
@@ -4215,17 +4215,17 @@ var SessionStoreInternal = {
     this.markTabAsRestoring(aTab);
 
     let newFrameloader = aOptions.newFrameloader;
 
     let isRemotenessUpdate;
     if (aOptions.remoteType !== undefined) {
       // We already have a selected remote type so we update to that.
       isRemotenessUpdate =
-        tabbrowser.updateBrowserRemoteness(browser, !!aOptions.remoteType,
+        tabbrowser.updateBrowserRemoteness(browser,
                                            { remoteType: aOptions.remoteType,
                                              newFrameloader });
     } else {
       isRemotenessUpdate =
         tabbrowser.updateBrowserRemotenessByURL(browser, uri, {
           newFrameloader,
         });
     }
--- a/browser/components/sessionstore/test/browser_remoteness_flip_on_restore.js
+++ b/browser/components/sessionstore/test/browser_remoteness_flip_on_restore.js
@@ -115,18 +115,19 @@ async function runScenarios(scenarios) {
         // any of the additional ones required by this test.
         info("Opening a new tab");
         tab = await BrowserTestUtils.openNewForegroundTab(tabbrowser);
       } else {
         info("Using the selected tab");
         tab = tabbrowser.selectedTab;
       }
       let browser = tab.linkedBrowser;
-      let remotenessState = scenario.initialRemoteness[i];
-      tabbrowser.updateBrowserRemoteness(browser, remotenessState);
+      let remotenessState = scenario.initialRemoteness[i] ?
+          E10SUtils.DEFAULT_REMOTE_TYPE : E10SUtils.NOT_REMOTE;
+      tabbrowser.updateBrowserRemoteness(browser, { remoteType: remotenessState });
     }
 
     // And select the requested tab.
     let tabToSelect = tabbrowser.tabs[scenario.initialSelectedTab - 1];
     if (tabbrowser.selectedTab != tabToSelect) {
       await BrowserTestUtils.switchTab(tabbrowser, tabToSelect);
     }
 
--- a/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js
+++ b/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js
@@ -84,17 +84,19 @@ add_task(async function step_5() {
 
 add_task(async function step_6() {
   info("Running step 6 - check swapBrowsersAndCloseOther preserves registered switch-to-tab result");
   let tabToKeep = BrowserTestUtils.addTab(gBrowser);
   let tab = BrowserTestUtils.addTab(gBrowser);
   BrowserTestUtils.loadURI(tab.linkedBrowser, "about:mozilla");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
-  gBrowser.updateBrowserRemoteness(tabToKeep.linkedBrowser, tab.linkedBrowser.isRemoteBrowser);
+  gBrowser.updateBrowserRemoteness(tabToKeep.linkedBrowser,
+                                   { remoteType: tab.linkedBrowser.isRemoteBrowser ?
+                                     E10SUtils.DEFAULT_REMOTE_TYPE : E10SUtils.NOT_REMOTE });
   gBrowser.swapBrowsersAndCloseOther(tabToKeep, tab);
 
   await ensure_opentabs_match_db();
 
   BrowserTestUtils.removeTab(tabToKeep);
 
   await ensure_opentabs_match_db();
 });
--- a/browser/modules/ContentCrashHandlers.jsm
+++ b/browser/modules/ContentCrashHandlers.jsm
@@ -11,16 +11,17 @@ var EXPORTED_SYMBOLS = [ "TabCrashHandle
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
   clearTimeout: "resource://gre/modules/Timer.jsm",
   CrashSubmit: "resource://gre/modules/CrashSubmit.jsm",
+  E10SUtils: "resource://gre/modules/E10SUtils.jsm",
   PluralForm: "resource://gre/modules/PluralForm.jsm",
   RemotePages: "resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm",
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   setTimeout: "resource://gre/modules/Timer.jsm",
 });
 
 XPCOMUtils.defineLazyGetter(this, "gNavigatorBundle", function() {
   const url = "chrome://browser/locale/browser.properties";
@@ -314,17 +315,17 @@ var TabCrashHandler = {
     return false;
   },
 
   sendToRestartRequiredPage(browser) {
     let uri = browser.currentURI;
     let gBrowser = browser.ownerGlobal.gBrowser;
     let tab = gBrowser.getTabForBrowser(browser);
     // The restart required page is non-remote by default.
-    gBrowser.updateBrowserRemoteness(browser, false);
+    gBrowser.updateBrowserRemoteness(browser, { remoteType: E10SUtils.NOT_REMOTE });
 
     browser.docShell.displayLoadError(Cr.NS_ERROR_BUILDID_MISMATCH, uri, null);
     tab.setAttribute("crashed", true);
 
     // Make sure to only count once even if there are multiple windows
     // that will all show about:restartrequired.
     if (this._crashedTabCount == 1) {
       Services.telemetry.scalarAdd("dom.contentprocess.buildID_mismatch", 1);
@@ -340,17 +341,17 @@ var TabCrashHandler = {
    *        The browser that has recently crashed.
    */
   sendToTabCrashedPage(browser) {
     let title = browser.contentTitle;
     let uri = browser.currentURI;
     let gBrowser = browser.ownerGlobal.gBrowser;
     let tab = gBrowser.getTabForBrowser(browser);
     // The tab crashed page is non-remote by default.
-    gBrowser.updateBrowserRemoteness(browser, false);
+    gBrowser.updateBrowserRemoteness(browser, { remoteType: E10SUtils.NOT_REMOTE });
 
     browser.setAttribute("crashedPageTitle", title);
     browser.docShell.displayLoadError(Cr.NS_ERROR_CONTENT_CRASHED, uri, null);
     browser.removeAttribute("crashedPageTitle");
     tab.setAttribute("crashed", true);
   },
 
   /**
--- a/devtools/client/responsive.html/browser/swap.js
+++ b/devtools/client/responsive.html/browser/swap.js
@@ -139,17 +139,17 @@ function swapToInnerBrowser({ tab, conta
       // causes them to flip processes.
       //
       // Bug 1510806 has been filed to fix this properly, by making RDM resilient
       // to process flips.
       if (mustChangeProcess &&
           tab.linkedBrowser.remoteType == "privileged") {
         debug(`Tab must flip away from the privileged content process ` +
               `on navigation`);
-        gBrowser.updateBrowserRemoteness(tab.linkedBrowser, true, {
+        gBrowser.updateBrowserRemoteness(tab.linkedBrowser, {
           remoteType: requiredRemoteType,
         });
       }
 
       tab.isResponsiveDesignMode = true;
 
       // Hide the browser content temporarily while things move around to avoid displaying
       // strange intermediate states.
@@ -224,17 +224,19 @@ function swapToInnerBrowser({ tab, conta
       dispatchDevToolsBrowserSwap(tab.linkedBrowser, innerBrowser);
       debug("Swap content to inner browser");
       swapBrowserDocShells(tab, innerBrowser);
 
       // 5. Force the original browser tab to be non-remote since the tool UI
       //    must be loaded in the parent process, and we're about to swap the
       //    tool UI into this tab.
       debug("Flip original tab to remote false");
-      gBrowser.updateBrowserRemoteness(tab.linkedBrowser, false);
+      gBrowser.updateBrowserRemoteness(tab.linkedBrowser, {
+        remoteType: E10SUtils.NOT_REMOTE,
+      });
 
       // 6. Swap the tool UI (with viewport showing the content) into the
       //    original browser tab and close the temporary tab used to load the
       //    tool via `swapBrowsersAndCloseOther`.
       debug("Swap tool UI to original tab");
       swapBrowsersAndCloseOtherSilently(tab, containerTab);
 
       // 7. Start a tunnel from the tool tab's browser to the viewport browser
@@ -296,17 +298,17 @@ function swapToInnerBrowser({ tab, conta
       // Copy tab listener state flags to content tab.  See similar comment in `start`
       // above for more details.
       const stateFlags = gBrowser._tabListeners.get(tab).mStateFlags;
       gBrowser._tabListeners.get(contentTab).mStateFlags = stateFlags;
 
       // 5. Force the original browser tab to be remote since web content is
       //    loaded in the child process, and we're about to swap the content
       //    into this tab.
-      gBrowser.updateBrowserRemoteness(tab.linkedBrowser, true, {
+      gBrowser.updateBrowserRemoteness(tab.linkedBrowser, {
         remoteType: contentBrowser.remoteType,
       });
 
       // 6. Swap the content into the original browser tab and close the
       //    temporary tab used to hold the content via
       //    `swapBrowsersAndCloseOther`.
       dispatchDevToolsBrowserSwap(contentBrowser, tab.linkedBrowser);
       swapBrowsersAndCloseOtherSilently(tab, contentTab);
--- a/devtools/client/webreplay/menu.js
+++ b/devtools/client/webreplay/menu.js
@@ -13,38 +13,47 @@ const MENUS_L10N = new LocalizationHelpe
 function l10n(key) {
   return MENUS_L10N.getStr(key);
 }
 
 const ChromeUtils = require("ChromeUtils");
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
 
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+XPCOMUtils.defineLazyModuleGetters(this, {
+  E10SUtils: "resource://gre/modules/E10SUtils.jsm",
+});
+
 function RecordNewTab() {
   const { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
   gBrowser.selectedTab = gBrowser.addWebTab("about:blank", { recordExecution: "*" });
   Services.telemetry.scalarAdd("devtools.webreplay.new_recording", 1);
 }
 
 function ReloadAndRecordTab() {
   const { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
   const url = gBrowser.currentURI.spec;
-  gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true,
-                                   { recordExecution: "*", newFrameloader: true });
+  gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, {
+    recordExecution: "*", newFrameloader: true,
+    remoteType: E10SUtils.DEFAULT_REMOTE_TYPE,
+  });
   gBrowser.loadURI(url, {
     triggeringPrincipal: gBrowser.selectedBrowser.contentPrincipal,
   });
   Services.telemetry.scalarAdd("devtools.webreplay.reload_recording", 1);
 }
 
 function ReloadAndStopRecordingTab() {
   const { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
   const url = gBrowser.currentURI.spec;
-  gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true,
-                                   { newFrameloader: true });
+  gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, {
+    newFrameloader: true,
+    remoteType: E10SUtils.DEFAULT_REMOTE_TYPE,
+  });
   gBrowser.loadURI(url, {
     triggeringPrincipal: gBrowser.selectedBrowser.contentPrincipal,
   });
   Services.telemetry.scalarAdd("devtools.webreplay.stop_recording", 1);
 }
 
 function SaveRecording() {
   const { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
--- a/dom/base/test/browser_messagemanager_loadprocessscript.js
+++ b/dom/base/test/browser_messagemanager_loadprocessscript.js
@@ -141,17 +141,18 @@ add_task(async function() {
     let check = checkProcess(Services.ppmm);
     Services.ppmm.loadProcessScript(processScriptURL, true);
 
     // The main process should respond
     await check;
 
     check = checkProcess(Services.ppmm);
     // Reset the default browser to start a new child process
-    gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true);
+    gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser,
+                                     { remoteType: E10SUtils.DEFAULT_REMOTE_TYPE });
     BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
     await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
     checkBaseProcessCount("Should be back to the base number of processes at this point");
 
     // The new process should have responded
     await check;
 
--- a/testing/talos/talos/pageloader/chrome/pageloader.js
+++ b/testing/talos/talos/pageloader/chrome/pageloader.js
@@ -205,19 +205,19 @@ function plInit() {
         //
         // It also probably means that per test (or, in fact, per pageloader browser
         // instance which adds the load listener and injects tpRecordTime), all the
         // pages should be able to load in the same mode as the initial page - due
         // to this reinitialization on the switch.
         let remoteType = E10SUtils.getRemoteTypeForURI(pageUrls[0], true);
         let tabbrowser = browserWindow.gBrowser;
         if (remoteType) {
-          tabbrowser.updateBrowserRemoteness(tabbrowser.initialBrowser, true, { remoteType });
+          tabbrowser.updateBrowserRemoteness(tabbrowser.initialBrowser, { remoteType });
         } else {
-          tabbrowser.updateBrowserRemoteness(tabbrowser.initialBrowser, false);
+          tabbrowser.updateBrowserRemoteness(tabbrowser.initialBrowser, { remoteType: E10SUtils.NOT_REMOTE });
         }
 
         browserWindow.resizeTo(winWidth, winHeight);
         browserWindow.moveTo(0, 0);
         browserWindow.focus();
         content = browserWindow.getBrowser();
         content.selectedBrowser.messageManager.loadFrameScript("chrome://pageloader/content/utils.js", false, true);
 
--- a/toolkit/components/viewsource/ViewSourceBrowser.jsm
+++ b/toolkit/components/viewsource/ViewSourceBrowser.jsm
@@ -174,17 +174,17 @@ ViewSourceBrowser.prototype = {
       throw new Error("Must supply a URL when opening view source.");
     }
 
     if (browser) {
       this.browser.sameProcessAsFrameLoader = browser.frameLoader;
 
       // If we're dealing with a remote browser, then the browser
       // for view source needs to be remote as well.
-      this.updateBrowserRemoteness(browser.isRemoteBrowser, browser.remoteType);
+      this.updateBrowserRemoteness(browser.remoteType);
     } else if (outerWindowID) {
       throw new Error("Must supply the browser if passing the outerWindowID");
     }
 
     this.sendAsyncMessage("ViewSource:LoadSource",
                           { URL, outerWindowID, lineNumber });
   },
 
@@ -208,19 +208,18 @@ ViewSourceBrowser.prototype = {
    *
    * @param shouldBeRemote
    *        True if the browser should be made remote. If the browsers
    *        remoteness already matches this value, this function does
    *        nothing.
    * @param remoteType
    *        The type of remote browser process.
    */
-  updateBrowserRemoteness(shouldBeRemote, remoteType) {
-    if (this.browser.isRemoteBrowser != shouldBeRemote ||
-        this.browser.remoteType != remoteType) {
+  updateBrowserRemoteness(remoteType) {
+    if (this.browser.remoteType != remoteType) {
       // In this base case, where we are handed a <browser> someone else is
       // managing, we don't know for sure that it's safe to toggle remoteness.
       // For view source in a window, this is overridden to actually do the
       // flip if needed.
       throw new Error("View source browser's remoteness mismatch");
     }
   },
 
--- a/toolkit/content/tests/browser/browser_crash_previous_frameloader.js
+++ b/toolkit/content/tests/browser/browser_crash_previous_frameloader.js
@@ -92,17 +92,17 @@ add_task(async function test_crash_in_pr
       // page should receive the pagehide event, which we'll then
       // use to crash the frameloader.
       addEventListener("pagehide", function() {
         dump("\nEt tu, Brute?\n");
         dies();
       });
     });
 
-    gBrowser.updateBrowserRemoteness(browser, false);
+    gBrowser.updateBrowserRemoteness(browser, { remoteType: E10SUtils.NOT_REMOTE });
     info("Waiting for content process to go away.");
     let [subject /* , data */] = await contentProcessGone;
 
     // If we don't clean up the minidump, the harness will
     // complain.
     let dumpID = getCrashDumpId(subject);
 
     Assert.ok(dumpID, "There should be a dumpID");
--- a/toolkit/content/tests/browser/browser_findbar.js
+++ b/toolkit/content/tests/browser/browser_findbar.js
@@ -243,11 +243,13 @@ function promiseFindFinished(searchText,
 }
 
 function promiseRemotenessChange(tab, shouldBeRemote) {
   return new Promise((resolve) => {
     let browser = gBrowser.getBrowserForTab(tab);
     tab.addEventListener("TabRemotenessChange", function() {
       resolve();
     }, {once: true});
-    gBrowser.updateBrowserRemoteness(browser, shouldBeRemote);
+    let remoteType = shouldBeRemote ?
+        E10SUtils.DEFAULT_REMOTE_TYPE : E10SUtils.NOT_REMOTE;
+    gBrowser.updateBrowserRemoteness(browser, { remoteType });
   });
 }