Bug 1343056 - Take userTypedValue into account when saving tabs to disk. r=mikedeboer
authorMatheus Longaray <mlongaray@hp.com>
Thu, 02 Mar 2017 21:24:13 +0100
changeset 374888 32604a6dd45e988b485b3f93b2a5dc5410a89b1c
parent 374887 93af928758e78c567610e7d68ac2ff4f6fb8480b
child 374889 c5f07e7744d0ae707051ae57a2d9f642251bfc3f
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1343056
milestone54.0a1
Bug 1343056 - Take userTypedValue into account when saving tabs to disk. r=mikedeboer This patch adds userTypedValue data validation when saving tabs to disk MozReview-Commit-ID: EltANtbDfqe
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -4211,19 +4211,20 @@ var SessionStoreInternal = {
    *
    * @param aTabState
    *        The current tab state
    * @returns boolean
    */
   _shouldSaveTab: function ssi_shouldSaveTab(aTabState) {
     // If the tab has one of the following transient about: history entry,
     // then we don't actually want to write this tab's data to disk.
-    return aTabState.entries.length &&
-           !(aTabState.entries[0].url == "about:printpreview" ||
-             aTabState.entries[0].url == "about:privatebrowsing");
+    return aTabState.userTypedValue ||
+           (aTabState.entries.length &&
+            !(aTabState.entries[0].url == "about:printpreview" ||
+              aTabState.entries[0].url == "about:privatebrowsing"));
   },
 
   /**
    * This is going to take a state as provided at startup (via
    * nsISessionStartup.state) and split it into 2 parts. The first part
    * (defaultState) will be a state that should still be restored at startup,
    * while the second part (state) is a state that should be saved for later.
    * defaultState will be comprised of windows with only pinned tabs, extracted