Bug 918024 - Remove the synchronous fallback for reading in Session Store initialization. r=Yoric, f=ttaubert

This commit is contained in:
Steven MacLeod
2013-11-19 14:57:46 -05:00
parent 0ecec6d58d
commit 2f938f6bbb
11 changed files with 47 additions and 170 deletions

View File

@@ -549,7 +549,7 @@ nsBrowserContentHandler.prototype = {
}
var overridePage = "";
var haveUpdateSession = false;
var willRestoreSession = false;
try {
// Read the old value of homepage_override.mstone before
// needHomepageOverride updates it, so that we can later add it to the
@@ -568,11 +568,15 @@ nsBrowserContentHandler.prototype = {
overridePage = Services.urlFormatter.formatURLPref("startup.homepage_welcome_url");
break;
case OVERRIDE_NEW_MSTONE:
// Check whether we have a session to restore. If we do, we assume
// that this is an "update" session.
// Check whether we will restore a session. If we will, we assume
// that this is an "update" session. This does not take crashes
// into account because that requires waiting for the session file
// to be read. If a crash occurs after updating, before restarting,
// we may open the startPage in addition to restoring the session.
var ss = Components.classes["@mozilla.org/browser/sessionstartup;1"]
.getService(Components.interfaces.nsISessionStartup);
haveUpdateSession = ss.doRestore();
willRestoreSession = ss.isAutomaticRestoreEnabled();
overridePage = Services.urlFormatter.formatURLPref("startup.homepage_override_url");
if (prefb.prefHasUserValue("app.update.postupdate"))
overridePage = getPostUpdateOverridePage(overridePage);
@@ -600,7 +604,7 @@ nsBrowserContentHandler.prototype = {
startPage = "";
// Only show the startPage if we're not restoring an update session.
if (overridePage && startPage && !haveUpdateSession)
if (overridePage && startPage && !willRestoreSession)
return overridePage + "|" + startPage;
return overridePage || startPage || "about:blank";