Bug 630398 - Session store should ignore transient about:blank pageloads [r=mbrubeck]
authorMark Finkle <mfinkle@mozilla.com>
Wed, 27 Apr 2011 11:52:29 -0400
changeset 68675 e76e1efdc3a098780b3c4cbfacfe6e99a396380d
parent 68674 53bbbe42d31683355b4d855b91cf14776554b78a
child 68676 4c978d7f77e88689d42376959764098e6ef3ad44
push id19699
push usermfinkle@mozilla.com
push dateWed, 27 Apr 2011 15:52:50 +0000
treeherdermozilla-central@4c978d7f77e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs630398
milestone6.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 630398 - Session store should ignore transient about:blank pageloads [r=mbrubeck]
mobile/components/SessionStore.js
--- a/mobile/components/SessionStore.js
+++ b/mobile/components/SessionStore.js
@@ -373,16 +373,20 @@ SessionStore.prototype = {
     }
   },
 
   onTabLoad: function ss_onTabLoad(aWindow, aBrowser, aMessage) {
     // If this browser is being restored, skip any session save activity
     if (aBrowser.__SS_restore)
       return;
 
+    // Ignore a transient "about:blank"
+    if (!aBrowser.canGoBack && aBrowser.currentURI.spec == "about:blank")
+      return;
+
     delete aBrowser.__SS_data;
     this._collectTabData(aBrowser);
 
     // Save out the state as quickly as possible
     if (aMessage.name == "pageshow")
       this.saveStateNow();
     this._updateCrashReportURL(aWindow);
   },
@@ -412,18 +416,17 @@ SessionStore.prototype = {
       // Interval until the next disk operation is allowed
       let minimalDelay = this._lastSaveTime + this._interval - Date.now();
 
       // If we have to wait, set a timer, otherwise saveState directly
       let delay = Math.max(minimalDelay, 2000);
       if (delay > 0) {
         this._saveTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
         this._saveTimer.init(this, delay, Ci.nsITimer.TYPE_ONE_SHOT);
-      }
-      else {
+      } else {
         this.saveState();
       }
     }
   },
 
   saveStateNow: function ss_saveStateNow() {
     // Kill any queued timer and save immediately
     if (this._saveTimer) {