Bug 919532 - Make sure we don't lose state when quitting early without being notified; r=yoric

This commit is contained in:
Tim Taubert 2013-10-06 14:36:01 -07:00
Родитель 65e06ae25f
Коммит b5ecb8cc40
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -2462,12 +2462,19 @@ let SessionStoreInternal = {
delete this._statesToRestore[aWindow.__SS_restoreID];
delete aWindow.__SS_restoreID;
delete this._windows[aWindow.__SSi]._restoring;
// It's important to set the window state to dirty so that
// we collect their data for the first time when saving state.
DirtyWindows.add(aWindow);
}
// It's important to set the window state to dirty so that
// we collect their data for the first time when saving state.
DirtyWindows.add(aWindow);
// Set the state to restore as the window's current state. Normally, this
// will just be overridden the next time we collect state but we need this
// as a fallback should Firefox be shutdown early without notifying us
// beforehand.
this._windows[aWindow.__SSi].tabs = aTabData.slice();
this._windows[aWindow.__SSi].selected = aSelectTab;
if (aTabs.length == 0) {
// this is normally done in restoreHistory() but as we're returning early
// here we need to take care of it.