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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user