Bug 1929190 - QM: Initialize temporary origin even if a previous initialization attempt failed; r=dom-storage-reviewers,asuth

Differential Revision: https://phabricator.services.mozilla.com/D228670
This commit is contained in:
Jan Varga 2024-11-13 00:38:30 +00:00
parent a6f73e6ce1
commit 5e21e285f9
2 changed files with 10 additions and 6 deletions

View File

@ -6126,6 +6126,13 @@ QuotaManager::EnsureTemporaryOriginIsInitializedInternal(
// Don't need to traverse the directory, since it's empty.
InitQuotaForOrigin(fullOriginMetadata, ClientUsageArray(),
/* aUsageBytes */ 0);
} else {
QM_TRY_INSPECT(const auto& metadata,
LoadFullOriginMetadataWithRestore(directory));
QM_TRY(MOZ_TO_RESULT(InitializeOrigin(metadata.mPersistenceType, metadata,
metadata.mLastAccessTime,
metadata.mPersisted, directory)));
}
// TODO: If the metadata file exists and we didn't call
@ -6136,6 +6143,8 @@ QuotaManager::EnsureTemporaryOriginIsInitializedInternal(
// origin will be marked as "accessed", so
// LoadFullOriginMetadataWithRestore will be called for the metadata
// file in next session in LoadQuotaFromCache.
// (If a previous origin initialization failed, we actually do call
// LoadFullOriginMetadataWithRestore which updates the group)
return std::pair(std::move(directory), created);
};

View File

@ -175,10 +175,5 @@ async function testCreateConnection() {
/* exported testSteps */
async function testSteps() {
add_task(testCachedOrigins);
add_task(
{
skip_if: () => true,
},
testCreateConnection
);
add_task(testCreateConnection);
}