Skip to content

Commit

Permalink
Bug 1929190 - QM: Initialize temporary origin even if a previous init…
Browse files Browse the repository at this point in the history
…ialization attempt failed; r=dom-storage-reviewers,asuth

Differential Revision: https://phabricator.services.mozilla.com/D228670
  • Loading branch information
janvarga committed Nov 13, 2024
1 parent a6f73e6 commit 5e21e28
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 9 additions & 0 deletions dom/quota/ActorsParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,5 @@ async function testCreateConnection() {
/* exported testSteps */
async function testSteps() {
add_task(testCachedOrigins);
add_task(
{
skip_if: () => true,
},
testCreateConnection
);
add_task(testCreateConnection);
}

0 comments on commit 5e21e28

Please sign in to comment.