Bug 871057 - Simplify session store initialization; r=ttaubert

This commit is contained in:
Bill McCloskey 2013-06-17 11:51:43 +02:00
parent 6663450684
commit b394092bf1

View File

@ -494,23 +494,16 @@ let SessionStoreInternal = {
}, },
_initWindow: function ssi_initWindow(aWindow) { _initWindow: function ssi_initWindow(aWindow) {
if (!aWindow || this._loadState == STATE_RUNNING) { if (aWindow) {
// make sure that all browser windows which try to initialize this.onLoad(aWindow);
// SessionStore are really tracked by it } else if (this._loadState == STATE_STOPPED) {
if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi]))
this.onLoad(aWindow);
// If init is being called with a null window, it's possible that we // If init is being called with a null window, it's possible that we
// just want to tell sessionstore that a session is live (as is the case // just want to tell sessionstore that a session is live (as is the case
// with starting Firefox with -private, for example; see bug 568816), // with starting Firefox with -private, for example; see bug 568816),
// so we should mark the load state as running to make sure that // so we should mark the load state as running to make sure that
// things like setBrowserState calls will succeed in restoring the session. // things like setBrowserState calls will succeed in restoring the session.
if (!aWindow && this._loadState == STATE_STOPPED) this._loadState = STATE_RUNNING;
this._loadState = STATE_RUNNING;
return;
} }
// As this is called at delayedStartup, restoration must be initiated here
this.onLoad(aWindow);
}, },
/** /**