From 6ed441a296567a1bff2c543f66d0b633ca6e9e4b Mon Sep 17 00:00:00 2001 From: Mike Connor Date: Sat, 4 Apr 2009 21:28:25 +0200 Subject: [PATCH] Bug 483566 - When clearing visited pages on shutdown, saved data is saved or lost depending on shutdown method. r=dietrich --- browser/components/sessionstore/src/nsSessionStore.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js index f279feef43e8..2873d02dd27f 100644 --- a/browser/components/sessionstore/src/nsSessionStore.js +++ b/browser/components/sessionstore/src/nsSessionStore.js @@ -161,6 +161,9 @@ SessionStoreService.prototype = { // whether we are in private browsing mode _inPrivateBrowsing: false, + // whether we clearing history on shutdown + _clearingOnShutdown: false, + /* ........ Global Event Handlers .............. */ /** @@ -352,6 +355,8 @@ SessionStoreService.prototype = { // Delete the private browsing backed up state, if any if ("_stateBackup" in this) delete this._stateBackup; + if (this._loadState == STATE_QUITTING) + this._clearingOnShutdown = true; break; case "browser:purge-domain-data": // does a session history entry contain a url for the given domain? @@ -2427,8 +2432,11 @@ SessionStoreService.prototype = { * @returns bool */ _doResumeSession: function sss_doResumeSession() { + if (this._clearingOnShutdown) + return false; + return this._prefBranch.getIntPref("startup.page") == 3 || - this._prefBranch.getBoolPref("sessionstore.resume_session_once"); + this._prefBranch.getBoolPref("sessionstore.resume_session_once"); }, /**