Bug 998267 - Don't always show the throbber when opening new tabs in e10s r=billm
authorTim Taubert <ttaubert@mozilla.com>
Thu, 25 Sep 2014 05:34:47 +0200
changeset 222633 51f1360f4e852b5c322bfc64adb233fad86a6565
parent 222632 689487642c03fa0a7ecae8e511dfa901806d7723
child 222634 3180facaf9439bc686d21c20713d06189ecfb1e4
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs998267
milestone35.0a1
Bug 998267 - Don't always show the throbber when opening new tabs in e10s r=billm
browser/base/content/tabbrowser.xml
toolkit/content/browser-child.js
toolkit/modules/RemoteWebProgress.jsm
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -575,19 +575,16 @@
               Array.unshift(arguments, this.mBrowser);
               return this.mTabBrowser._callProgressListeners.apply(this.mTabBrowser, arguments);
             },
 
             _shouldShowProgress: function (aRequest) {
               if (this.mBlank)
                 return false;
 
-              if (gMultiProcessBrowser)
-                return true;
-
               // Don't show progress indicators in tabs for about: URIs
               // pointing to local resources.
               try {
                 let channel = aRequest.QueryInterface(Ci.nsIChannel);
                 if (channel.originalURI.schemeIs("about") &&
                     (channel.URI.schemeIs("jar") || channel.URI.schemeIs("file")))
                   return false;
               } catch (e) {}
--- a/toolkit/content/browser-child.js
+++ b/toolkit/content/browser-child.js
@@ -35,27 +35,28 @@ FocusSyncHandler.init();
 
 let WebProgressListener = {
   init: function() {
     let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
                               .getInterface(Ci.nsIWebProgress);
     webProgress.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_ALL);
   },
 
-  _requestSpec: function (aRequest) {
+  _requestSpec: function (aRequest, aPropertyName) {
     if (!aRequest || !(aRequest instanceof Ci.nsIChannel))
       return null;
-    return aRequest.QueryInterface(Ci.nsIChannel).URI.spec;
+    return aRequest.QueryInterface(Ci.nsIChannel)[aPropertyName].spec;
   },
 
   _setupJSON: function setupJSON(aWebProgress, aRequest) {
     return {
       isTopLevel: aWebProgress.isTopLevel,
       isLoadingDocument: aWebProgress.isLoadingDocument,
-      requestURI: this._requestSpec(aRequest),
+      requestURI: this._requestSpec(aRequest, "URI"),
+      originalRequestURI: this._requestSpec(aRequest, "originalURI"),
       loadType: aWebProgress.loadType,
       documentContentType: content.document && content.document.contentType
     };
   },
 
   _setupObjects: function setupObjects(aWebProgress) {
     return {
       contentWindow: content,
--- a/toolkit/modules/RemoteWebProgress.jsm
+++ b/toolkit/modules/RemoteWebProgress.jsm
@@ -12,25 +12,27 @@ const Cu = Components.utils;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function newURI(spec)
 {
     return Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
                                                     .newURI(spec, null, null);
 }
 
-function RemoteWebProgressRequest(spec)
+function RemoteWebProgressRequest(spec, originalSpec)
 {
-  this.uri = newURI(spec);
+  this._uri = newURI(spec);
+  this._originalURI = newURI(originalSpec);
 }
 
 RemoteWebProgressRequest.prototype = {
   QueryInterface : XPCOMUtils.generateQI([Ci.nsIChannel]),
 
-  get URI() { return this.uri.clone(); }
+  get URI() { return this._uri.clone(); },
+  get originalURI() { return this._originalURI.clone(); }
 };
 
 function RemoteWebProgress(aManager, aIsTopLevel) {
   this._manager = aManager;
 
   this._isLoadingDocument = false;
   this._DOMWindow = null;
   this._isTopLevel = aIsTopLevel;
@@ -139,18 +141,21 @@ RemoteWebProgressManager.prototype = {
 
     // The top-level WebProgress is always the same, but because we don't
     // really have a concept of subframes/content we always creat a new object
     // for those.
     let webProgress = json.isTopLevel ? this._topLevelWebProgress
                                       : new RemoteWebProgress(this, false);
 
     // The WebProgressRequest object however is always dynamic.
-    let request = json.requestURI ? new RemoteWebProgressRequest(json.requestURI)
-                                  : null;
+    let request = null;
+    if (json.requestURI) {
+      request = new RemoteWebProgressRequest(json.requestURI,
+                                             json.originalRequestURI);
+    }
 
     // Update the actual WebProgress fields.
     webProgress._isLoadingDocument = json.isLoadingDocument;
     webProgress._DOMWindow = objects.DOMWindow;
     webProgress._loadType = json.loadType;
 
     if (json.isTopLevel) {
       this._browser._contentWindow = objects.contentWindow;