Bug 1282830 - Trigger session saves when closing zombie tabs, too. r=sebastian draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Tue, 28 Jun 2016 23:29:57 +0200
changeset 385090 3e217b3f0c760182ac97e670c558c390bcc8d81b
parent 385089 b644837b2019bc94c4371c3eea8f58065713eec7
child 524850 e95a28026c555f1c7c24afb5a33e3b6e034c45ac
push id22426
push usermozilla@buttercookie.de
push dateThu, 07 Jul 2016 17:44:56 +0000
reviewerssebastian
bugs1282830
milestone50.0a1
Bug 1282830 - Trigger session saves when closing zombie tabs, too. r=sebastian A tab being in a delay-loaded "zombie" state or not shouldn't have any influence on the behaviour of onTabRemove - since we remove it from the session store's sphere of influence, its __SS_data can be safely deleted anyway and whether or not a session save needs to be triggered should depend only on the aNoNotfication parameter passed by the caller. Otherwise, with the current behaviour, the fact that those tabs have been closed will not get saved to disk if no subsequent session save is triggered through any other means (e.g. selecting a different tab, scrolling, ...) before closing Firefox. MozReview-Commit-ID: IxjZRRutc7A
mobile/android/components/SessionStore.js
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -491,27 +491,20 @@ SessionStore.prototype = {
     aBrowser.removeEventListener("load", this, true);
     aBrowser.removeEventListener("pageshow", this, true);
     aBrowser.removeEventListener("change", this, true);
     aBrowser.removeEventListener("input", this, true);
     aBrowser.removeEventListener("DOMAutoComplete", this, true);
     aBrowser.removeEventListener("scroll", this, true);
     aBrowser.removeEventListener("resize", this, true);
 
-    let tabId = aWindow.BrowserApp.getTabForBrowser(aBrowser).id;
-
-    // If this browser is being restored, skip any session save activity
-    if (aBrowser.__SS_restore) {
-      log("onTabRemove() ran for zombie tab " + tabId + ", aNoNotification = " + aNoNotification);
-      return;
-    }
-
     delete aBrowser.__SS_data;
 
-    log("onTabRemove() ran for tab " + tabId + ", aNoNotification = " + aNoNotification);
+    log("onTabRemove() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id +
+        ", aNoNotification = " + aNoNotification);
     if (!aNoNotification) {
       this.saveStateDelayed();
     }
   },
 
   onTabClose: function ss_onTabClose(aWindow, aBrowser, aTabIndex) {
     if (this._maxTabsUndo == 0) {
       return;