Bug 1950564 - QM: Add a shutdown check to QuotaManager::EnsureTemporaryGroupIsInitializedInternal; r=dom-storage-reviewers,jstutte

Differential Revision: https://phabricator.services.mozilla.com/D240577
This commit is contained in:
Jan Varga
2025-03-14 11:42:45 +00:00
parent 2eabd2650f
commit 4af161750d
2 changed files with 5 additions and 1 deletions

View File

@@ -5862,6 +5862,10 @@ Result<Ok, nsresult> QuotaManager::EnsureTemporaryGroupIsInitializedInternal(
// origins. This is going to change soon with the planned asynchronous
// temporary origin initialization done in the background.
for (const auto& originMetadata : *array) {
if (NS_WARN_IF(IsShuttingDown())) {
return Err(NS_ERROR_ABORT);
}
if (IsTemporaryOriginInitializedInternal(originMetadata)) {
continue;
}

View File

@@ -176,7 +176,7 @@ async function testShutdownDuringAllTemporaryOriginsInitialization() {
// fail. However, we can determine if the initialization of all origins was
// aborted due to shutdown by checking for the existence of origin metadata
// files, which were artificially removed earlier.
todo(
Assert.ok(
metadata1.exists() != metadata2.exists(),
"Metadata for the second origin is not restored"
);