Bug 699322: Making sure document load starts after a message is sent to Java [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Wed, 02 Nov 2011 21:27:57 -0700
changeset 81716 b882c5137a0779e0242a0e9ab638c985eadef971
parent 81715 0571e6fb4b44ef509a9f5476634b1330039ee5d4
child 81717 15595d5edb2c8077b267438622fb68735a3680ca
push id21573
push userblassey@mozilla.com
push dateTue, 06 Dec 2011 18:57:07 +0000
treeherdermozilla-central@0e397568c71e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs699322
milestone10.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 699322: Making sure document load starts after a message is sent to Java [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -675,32 +675,31 @@ Tab.prototype = {
     if (this.browser)
       return;
 
     this.browser = document.createElement("browser");
     this.browser.setAttribute("type", "content");
     BrowserApp.deck.appendChild(this.browser);
     this.browser.stop();
 
-    let flags = Ci.nsIWebProgress.NOTIFY_STATE_ALL |
-                Ci.nsIWebProgress.NOTIFY_LOCATION;
-    this.browser.addProgressListener(this, flags);
-    this.browser.sessionHistory.addSHistoryListener(this);
-    this.browser.loadURI(aURL);
-
     this.id = ++gTabIDFactory;
     let message = {
       gecko: {
         type: "Tab:Added",
         tabID: this.id,
         uri: aURL
       }
     };
+    sendMessageToJava(message);
 
-    sendMessageToJava(message);
+    let flags = Ci.nsIWebProgress.NOTIFY_STATE_ALL |
+                Ci.nsIWebProgress.NOTIFY_LOCATION;
+    this.browser.addProgressListener(this, flags);
+    this.browser.sessionHistory.addSHistoryListener(this);
+    this.browser.loadURI(aURL);
   },
 
   destroy: function() {
     if (!this.browser)
       return;
 
     this.browser.removeProgressListener(this);
     BrowserApp.deck.removeChild(this.browser);