diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /browser/components/sessionstore/SessionStartup.sys.mjs | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/sessionstore/SessionStartup.sys.mjs')
-rw-r--r-- | browser/components/sessionstore/SessionStartup.sys.mjs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/browser/components/sessionstore/SessionStartup.sys.mjs b/browser/components/sessionstore/SessionStartup.sys.mjs index ff3ba55176..0d017ac035 100644 --- a/browser/components/sessionstore/SessionStartup.sys.mjs +++ b/browser/components/sessionstore/SessionStartup.sys.mjs @@ -158,6 +158,11 @@ export var SessionStartup = { */ _onSessionFileRead({ source, parsed, noFilesFound }) { this._initialized = true; + const crashReasons = { + FINAL_STATE_WRITING_INCOMPLETE: "final-state-write-incomplete", + SESSION_STATE_FLAG_MISSING: + "session-state-missing-or-running-at-last-write", + }; // Let observers modify the state before it is used let supportsStateString = this._createSupportsString(source); @@ -210,12 +215,17 @@ export var SessionStartup = { delete this._initialState.lastSessionState; } + let previousSessionCrashedReason = "N/A"; lazy.CrashMonitor.previousCheckpoints.then(checkpoints => { if (checkpoints) { // If the previous session finished writing the final state, we'll // assume there was no crash. this._previousSessionCrashed = !checkpoints["sessionstore-final-state-write-complete"]; + if (!checkpoints["sessionstore-final-state-write-complete"]) { + previousSessionCrashedReason = + crashReasons.FINAL_STATE_WRITING_INCOMPLETE; + } } else if (noFilesFound) { // If the Crash Monitor could not load a checkpoints file it will // provide null. This could occur on the first run after updating to @@ -241,6 +251,13 @@ export var SessionStartup = { this._previousSessionCrashed = !stateFlagPresent || this._initialState.session.state == STATE_RUNNING_STR; + if ( + !stateFlagPresent || + this._initialState.session.state == STATE_RUNNING_STR + ) { + previousSessionCrashedReason = + crashReasons.SESSION_STATE_FLAG_MISSING; + } } // Report shutdown success via telemetry. Shortcoming here are @@ -249,6 +266,16 @@ export var SessionStartup = { Services.telemetry .getHistogramById("SHUTDOWN_OK") .add(!this._previousSessionCrashed); + Services.telemetry.recordEvent( + "session_restore", + "shutdown_success", + "session_startup", + null, + { + shutdown_ok: this._previousSessionCrashed.toString(), + shutdown_reason: previousSessionCrashedReason, + } + ); Services.obs.addObserver(this, "sessionstore-windows-restored", true); @@ -268,7 +295,7 @@ export var SessionStartup = { /** * Handle notifications */ - observe(subject, topic, data) { + observe(subject, topic) { switch (topic) { case "sessionstore-windows-restored": Services.obs.removeObserver(this, "sessionstore-windows-restored"); |