Bug 1749996 - Ensure CrashMonitor writes sessionstore final checkpoint before IOUtils shuts down r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D137797
This commit is contained in:
Barret Rennie
2022-02-05 20:57:50 +00:00
parent adf619e081
commit 3e6dfbcf31
2 changed files with 38 additions and 10 deletions

View File

@@ -28,9 +28,6 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
const { AsyncShutdown } = ChromeUtils.import(
"resource://gre/modules/AsyncShutdown.jsm"
);
XPCOMUtils.defineLazyModuleGetters(this, {
RunState: "resource:///modules/sessionstore/RunState.jsm",
@@ -488,7 +485,7 @@ var SessionFileInternal = {
// Ensure that we can write sessionstore.js cleanly before the profile
// becomes unaccessible.
AsyncShutdown.profileBeforeChange.addBlocker(
IOUtils.profileBeforeChange.addBlocker(
"SessionFile: Finish writing Session Restore data",
promise,
{
@@ -506,7 +503,7 @@ var SessionFileInternal = {
// doesn't forward the rejection.
return promise.then(() => {
// Remove the blocker, no matter if writing failed or not.
AsyncShutdown.profileBeforeChange.removeBlocker(promise);
IOUtils.profileBeforeChange.removeBlocker(promise);
if (isFinalWrite) {
Services.obs.notifyObservers(