Bug 1437382 - Part 11 - Shorten save delay when private tabs are closed. r?esawin draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 17 Feb 2018 16:42:13 +0100
changeset 761294 a6abfcd8af5c6f19d57fe52fbaf071d496d9049a
parent 761293 ce36990aed01026cfea48381ff93094a1573d4e8
push id100929
push usermozilla@buttercookie.de
push dateWed, 28 Feb 2018 22:01:37 +0000
reviewersesawin
bugs1437382
milestone60.0a1
Bug 1437382 - Part 11 - Shorten save delay when private tabs are closed. r?esawin In most cases (e.g. new tabs added, page navigation, scrolling, etc.), we can live with the fact the the private tab data held by GeckoApp might be up to ~10 seconds out of date if we don't manage to send an update within the time limit given by the UI during backgrounding. Where the closing of private tabs is concerned, this is different, as not remembering that the user already closed some tabs just before switching away from Firefox could lead to potentially embarrassing situations when the user returns and unexpectedly finds those tabs still open. Therefore we now use the infrastructure added in the previous parts to speed up the saving process when private tabs are closed. MozReview-Commit-ID: KpfXinOl5Ki
mobile/android/components/SessionStore.js
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -662,17 +662,18 @@ SessionStore.prototype = {
       delete aBrowser.__SS_historyChange;
     }
 
     delete aBrowser.__SS_data;
 
     log("onTabRemove() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id +
         ", aNoNotification = " + aNoNotification);
     if (!aNoNotification) {
-      this.saveStateDelayed();
+      let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(aBrowser);
+      this.saveStateDelayed(isPrivate);
     }
   },
 
   onTabClose: function ss_onTabClose(aWindow, aBrowser, aTabIndex) {
     let data = aBrowser.__SS_data;
     let tab = aWindow.BrowserApp.getTabForId(data.tabId);
 
     if (this._maxTabsUndo == 0 || this._sessionDataIsEmpty(data)) {