author | Kathy Brade <brade@pearlcrescent.com> |
Mon, 12 Feb 2018 22:08:00 +0200 | |
changeset 404142 | 1bd07bb7833c6326d8d128dce9df6618431922ef |
parent 404141 | 0be0607b050e9eeaff114166618b0e486dcaa79b |
child 404143 | 114d2a3202c0ddf706461952d63a14d35611f734 |
push id | 33454 |
push user | nbeleuzu@mozilla.com |
push date | Fri, 16 Feb 2018 12:30:01 +0000 |
treeherder | mozilla-central@928f0f09172f [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mikedeboer |
bugs | 1433523, 18292 |
milestone | 60.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -310,17 +310,19 @@ BrowserGlue.prototype = { _saveSession: false, _migrationImportsDefaultBookmarks: false, _placesBrowserInitComplete: false, _setPrefToSaveSession: function BG__setPrefToSaveSession(aForce) { if (!this._saveSession && !aForce) return; - Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true); + if (!PrivateBrowsingUtils.permanentPrivateBrowsing) { + Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true); + } // This method can be called via [NSApplication terminate:] on Mac, which // ends up causing prefs not to be flushed to disk, so we need to do that // explicitly here. See bug 497652. Services.prefs.savePrefFile(null); }, _setSyncAutoconnectDelay: function BG__setSyncAutoconnectDelay() {
--- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -1714,17 +1714,20 @@ var SessionStoreInternal = { /** * On quitting application * @param aData * String type of quitting */ onQuitApplication: function ssi_onQuitApplication(aData) { if (aData == "restart") { - this._prefBranch.setBoolPref("sessionstore.resume_session_once", true); + if (!PrivateBrowsingUtils.permanentPrivateBrowsing) { + this._prefBranch.setBoolPref("sessionstore.resume_session_once", true); + } + // The browser:purge-session-history notification fires after the // quit-application notification so unregister the // browser:purge-session-history notification to prevent clearing // session data on disk on a restart. It is also unnecessary to // perform any other sanitization processing on a restart as the // browser is about to exit anyway. Services.obs.removeObserver(this, "browser:purge-session-history"); }
--- a/browser/components/sessionstore/nsSessionStartup.js +++ b/browser/components/sessionstore/nsSessionStartup.js @@ -291,16 +291,20 @@ SessionStartup.prototype = { /** * Determines whether automatic session restoration is enabled for this * launch of the browser. This does not include crash restoration. In * particular, if session restore is configured to restore only in case of * crash, this method returns false. * @returns bool */ isAutomaticRestoreEnabled() { + if (PrivateBrowsingUtils.permanentPrivateBrowsing) { + return false; + } + return Services.prefs.getBoolPref("browser.sessionstore.resume_session_once") || Services.prefs.getIntPref("browser.startup.page") == BROWSER_STARTUP_RESUME_SESSION; }, /** * Determines whether there is a pending session restore. * @returns bool */