зеркало из https://github.com/mozilla/gecko-dev.git
Bug 665260 - Store start time in sessionstore data [r=dietrich]
This commit is contained in:
Родитель
8b11e411f2
Коммит
65bca0d683
|
@ -198,6 +198,10 @@ SessionStoreService.prototype = {
|
|||
// time in milliseconds (Date.now()) when the session was last written to file
|
||||
_lastSaveTime: 0,
|
||||
|
||||
// time in milliseconds when the session was started (saved across sessions),
|
||||
// defaults to now if no session was restored or timestamp doesn't exist
|
||||
_sessionStartTime: Date.now(),
|
||||
|
||||
// states for all currently opened windows
|
||||
_windows: {},
|
||||
|
||||
|
@ -344,6 +348,11 @@ SessionStoreService.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
// Load the session start time from the previous state
|
||||
this._sessionStartTime = this._initialState.session &&
|
||||
this._initialState.session.startTime ||
|
||||
this._sessionStartTime;
|
||||
|
||||
// make sure that at least the first window doesn't have anything hidden
|
||||
delete this._initialState.windows[0].hidden;
|
||||
// Since nothing is hidden in the first window, it cannot be a popup
|
||||
|
@ -1509,9 +1518,13 @@ SessionStoreService.prototype = {
|
|||
this._closedWindows = this._closedWindows.concat(lastSessionState._closedWindows);
|
||||
this._capClosedWindows();
|
||||
}
|
||||
// Set recent crashes
|
||||
|
||||
// Set data that persists between sessions
|
||||
this._recentCrashes = lastSessionState.session &&
|
||||
lastSessionState.session.recentCrashes || 0;
|
||||
this._sessionStartTime = lastSessionState.session &&
|
||||
lastSessionState.session.startTime ||
|
||||
this._sessionStartTime;
|
||||
|
||||
this._lastSessionState = null;
|
||||
},
|
||||
|
@ -3420,7 +3433,8 @@ SessionStoreService.prototype = {
|
|||
|
||||
oState.session = {
|
||||
state: this._loadState == STATE_RUNNING ? STATE_RUNNING_STR : STATE_STOPPED_STR,
|
||||
lastUpdate: Date.now()
|
||||
lastUpdate: Date.now(),
|
||||
startTime: this._sessionStartTime
|
||||
};
|
||||
if (this._recentCrashes)
|
||||
oState.session.recentCrashes = this._recentCrashes;
|
||||
|
|
Загрузка…
Ссылка в новой задаче