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:
@@ -5862,6 +5862,10 @@ Result<Ok, nsresult> QuotaManager::EnsureTemporaryGroupIsInitializedInternal(
|
|||||||
// origins. This is going to change soon with the planned asynchronous
|
// origins. This is going to change soon with the planned asynchronous
|
||||||
// temporary origin initialization done in the background.
|
// temporary origin initialization done in the background.
|
||||||
for (const auto& originMetadata : *array) {
|
for (const auto& originMetadata : *array) {
|
||||||
|
if (NS_WARN_IF(IsShuttingDown())) {
|
||||||
|
return Err(NS_ERROR_ABORT);
|
||||||
|
}
|
||||||
|
|
||||||
if (IsTemporaryOriginInitializedInternal(originMetadata)) {
|
if (IsTemporaryOriginInitializedInternal(originMetadata)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ async function testShutdownDuringAllTemporaryOriginsInitialization() {
|
|||||||
// fail. However, we can determine if the initialization of all origins was
|
// fail. However, we can determine if the initialization of all origins was
|
||||||
// aborted due to shutdown by checking for the existence of origin metadata
|
// aborted due to shutdown by checking for the existence of origin metadata
|
||||||
// files, which were artificially removed earlier.
|
// files, which were artificially removed earlier.
|
||||||
todo(
|
Assert.ok(
|
||||||
metadata1.exists() != metadata2.exists(),
|
metadata1.exists() != metadata2.exists(),
|
||||||
"Metadata for the second origin is not restored"
|
"Metadata for the second origin is not restored"
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user