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
--- 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;