Bug 1254657 - change how we send Content:LoadURIResult to avoid upsetting RemoteWebProgress.jsm, r=mconley
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 08 Mar 2016 20:04:10 +0000
changeset 287338 75dbc6dae2958ff0fd6001eb4a484afddc323a73
parent 287337 43cc5a5867878f8d2baf029cdc6d57e593b14f00
child 287339 8783699e2953fe9ab84b3704b4b4778455e9917b
push id18085
push usergijskruitbosch@gmail.com
push dateWed, 09 Mar 2016 09:19:42 +0000
treeherderfx-team@75dbc6dae295 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1254657
milestone48.0a1
Bug 1254657 - change how we send Content:LoadURIResult to avoid upsetting RemoteWebProgress.jsm, r=mconley MozReview-Commit-ID: 7GR6H19ZUuN
toolkit/content/browser-child.js
toolkit/modules/RemoteWebProgress.jsm
--- a/toolkit/content/browser-child.js
+++ b/toolkit/content/browser-child.js
@@ -205,17 +205,17 @@ var WebProgressListener = {
     this._send("Content:SecurityChange", json, objects);
   },
 
   onRefreshAttempted: function onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI) {
     return true;
   },
 
   sendLoadCallResult() {
-    this._send("Content:LoadURIResult");
+    sendAsyncMessage("Content:LoadURIResult");
   },
 
   QueryInterface: function QueryInterface(aIID) {
     if (aIID.equals(Ci.nsIWebProgressListener) ||
         aIID.equals(Ci.nsIWebProgressListener2) ||
         aIID.equals(Ci.nsISupportsWeakReference) ||
         aIID.equals(Ci.nsISupports)) {
         return this;
--- a/toolkit/modules/RemoteWebProgress.jsm
+++ b/toolkit/modules/RemoteWebProgress.jsm
@@ -179,16 +179,23 @@ RemoteWebProgressManager.prototype = {
         }
       }
     }
   },
 
   receiveMessage: function (aMessage) {
     let json = aMessage.json;
     let objects = aMessage.objects;
+    // This message is a custom one we send as a result of a loadURI call.
+    // It shouldn't go through the same processing as all the forwarded
+    // webprogresslistener messages.
+    if (aMessage.name == "Content:LoadURIResult") {
+      this._browser.inLoadURI = false;
+      return;
+    }
 
     let webProgress = null;
     let isTopLevel = json.webProgress && json.webProgress.isTopLevel;
     // The top-level WebProgress is always the same, but because we don't
     // really have a concept of subframes/content we always create a new object
     // for those.
     if (json.webProgress) {
       webProgress = isTopLevel ? this._topLevelWebProgress
@@ -266,14 +273,11 @@ RemoteWebProgressManager.prototype = {
 
     case "Content:StatusChange":
       this._callProgressListeners("onStatusChange", webProgress, request, json.status, json.message);
       break;
 
     case "Content:ProgressChange":
       this._callProgressListeners("onProgressChange", webProgress, request, json.curSelf, json.maxSelf, json.curTotal, json.maxTotal);
       break;
-    case "Content:LoadURIResult":
-      this._browser.inLoadURI = false;
-      break;
     }
   },
 };