Backed out changeset ec84ee6acb88 (bug 1147911)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 23 Nov 2016 18:33:06 +0100
changeset 324116 feadf85d42ecbf5ab59d36fc7e86beb7fde54a6a
parent 324115 fc8e1019ebff3a7fccab860f338dc83930f6b6a7
child 324117 bbaedc341b7c6da5ed780fe657ca80445a814c29
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
bugs1147911
milestone53.0a1
backs outec84ee6acb880a630dbdd274b074713984a75ed7
Backed out changeset ec84ee6acb88 (bug 1147911)
browser/base/content/browser.js
testing/talos/talos/pageloader/chrome/pageloader.js
xpfe/appshell/nsIXULBrowserWindow.idl
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4204,20 +4204,20 @@ var XULBrowserWindow = {
     var securityUI = gBrowser.securityUI;
     this.onSecurityChange(null, null, securityUI.state, true);
   },
 
   setJSStatus: function() {
     // unsupported
   },
 
-  forceInitialBrowserRemote: function(aRemoteType) {
+  forceInitialBrowserRemote: function() {
     let initBrowser =
       document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
-    gBrowser.updateBrowserRemoteness(initBrowser, true, aRemoteType, null);
+    return initBrowser.frameLoader.tabParent;
   },
 
   forceInitialBrowserNonRemote: function(aOpener) {
     let initBrowser =
       document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
     gBrowser.updateBrowserRemoteness(initBrowser, false, E10SUtils.NOT_REMOTE, aOpener);
   },
 
--- a/testing/talos/talos/pageloader/chrome/pageloader.js
+++ b/testing/talos/talos/pageloader/chrome/pageloader.js
@@ -216,37 +216,41 @@ function plInit() {
 
       gPaintWindow = browserWindow;
       // get our window out of the way
       window.resizeTo(10,10);
 
       var browserLoadFunc = function (ev) {
         browserWindow.removeEventListener('load', browserLoadFunc, true);
 
+        function firstPageCanLoadAsRemote() {
+          return E10SUtils.canLoadURIInProcess(pageUrls[0], Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT);
+        }
+
         // do this half a second after load, because we need to be
         // able to resize the window and not have it get clobbered
         // by the persisted values
         setTimeout(function () {
                      // For e10s windows, since bug 1261842, the initial browser is remote unless
                      // it attempts to browse to a URI that should be non-remote (landed at bug 1047603).
                      //
-                     // However, when it loads a URI that requires a different remote type,
-                     // we lose the load listener and the injected tpRecordTime.remote,
+                     // However, when it loads such URI and reinitializes as non-remote, we lose the
+                     // load listener and the injected tpRecordTime.
+                     //
+                     // The preferred pageloader behaviour in e10s is to run the pages as as remote,
+                     // so if the page can load as remote, we will load it as remote.
                      //
                      // 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.
                      if (browserWindow.gMultiProcessBrowser) {
-                       let remoteType = E10SUtils.getRemoteTypeForURI(pageUrls[0], true);
-                       if (remoteType) {
-                         browserWindow.XULBrowserWindow.forceInitialBrowserRemote(remoteType);
-                       } else {
+                       if (!firstPageCanLoadAsRemote())
                          browserWindow.XULBrowserWindow.forceInitialBrowserNonRemote(null);
-                       }
+                       // Implicit else: initial browser in e10s is remote by default.
                      }
 
                      browserWindow.resizeTo(winWidth, winHeight);
                      browserWindow.moveTo(0, 0);
                      browserWindow.focus();
 
                      content = browserWindow.getBrowser();
                      gUseE10S = !gDisableE10S || (plPageFlags() & EXECUTE_SCROLL_TEST) ||
--- a/xpfe/appshell/nsIXULBrowserWindow.idl
+++ b/xpfe/appshell/nsIXULBrowserWindow.idl
@@ -38,21 +38,22 @@ interface nsIXULBrowserWindow : nsISuppo
    * Determines the appropriate target for a link.
    */
   AString onBeforeLinkTraversal(in AString originalTarget,
                                 in nsIURI linkURI,
                                 in nsIDOMNode linkNode,
                                 in boolean isAppTab);
 
   /**
-   * Find the initial browser of the window and set its remote attributes.
-   * This can be used to ensure that there is a browser in a new window of the
-   * correct type when it first spawns.
+   * Find the initial browser of the window and set its remote attribute.
+   * This can be used to ensure that there is a remote browser in a new
+   * window when it first spawns.
+   *
    */
-  void forceInitialBrowserRemote(in AString aRemoteType);
+  nsITabParent forceInitialBrowserRemote();
   void forceInitialBrowserNonRemote(in mozIDOMWindowProxy openerWindow);
 
   /**
    * Determines whether a load should continue.
    *
    * @param aDocShell
    *        The docshell performing the load.
    * @param aURI