Bug 1228518 - Don't send SessionStore:update for initial about:blank page load. r=ttaubert
authorMike Conley <mconley@mozilla.com>
Fri, 27 Nov 2015 15:11:31 -0500
changeset 308822 3b8b9e4abbaadf1ccd61cb51c8578e36f9d3e004
parent 308821 ea5faab36ba798635f99791e186d90c380997806
child 308823 996c67a6a11363e13efa4d77a8fe449c3081f221
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1228518
milestone45.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 1228518 - Don't send SessionStore:update for initial about:blank page load. r=ttaubert
browser/components/sessionstore/FrameTree.jsm
--- a/browser/components/sessionstore/FrameTree.jsm
+++ b/browser/components/sessionstore/FrameTree.jsm
@@ -214,16 +214,25 @@ FrameTreeInternal.prototype = {
   onStateChange: function (webProgress, request, stateFlags, status) {
     // Ignore state changes for subframes because we're only interested in the
     // top-document starting or stopping its load. We thus only care about any
     // changes to the root of the frame tree, not to any of its nodes/leafs.
     if (!webProgress.isTopLevel || webProgress.DOMWindow != this.content) {
       return;
     }
 
+    // onStateChange will be fired when loading the initial about:blank URI for
+    // a browser, which we don't actually care about. This is particularly for
+    // the case of unrestored background tabs, where the content has not yet
+    // been restored: we don't want to accidentally send any updates to the
+    // parent when the about:blank placeholder page has loaded.
+    if (!this._chromeGlobal.docShell.hasLoadedNonBlankURI) {
+      return;
+    }
+
     if (stateFlags & Ci.nsIWebProgressListener.STATE_START) {
       // Clear the list of frames until we can recollect it.
       this._frames.clear();
 
       // Notify observers that the frame tree has been reset.
       this.notifyObservers("onFrameTreeReset");
     } else if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
       // The document and its resources have finished loading.