Bug 1866217 - Scope temporary storage initialization to temporary and default repository only; r=dom-storage-reviewers,jari

Temporary storage initialization currently uses a directory lock over all
repositories which blocks any exclusive directory locks for the persistent
repository for no reason.

Differential Revision: https://phabricator.services.mozilla.com/D195389
This commit is contained in:
Jan Varga
2024-08-15 05:23:44 +00:00
parent 66a482019e
commit 79f4bd0fbf
3 changed files with 73 additions and 4 deletions

View File

@@ -1993,7 +1993,9 @@ RefPtr<BoolPromise> GetCachedOriginUsageOp::OpenDirectory() {
AssertIsOnOwningThread();
return OpenStorageDirectory(
PersistenceScope::CreateFromNull(),
PersistenceScope::CreateFromSet(PERSISTENCE_TYPE_TEMPORARY,
PERSISTENCE_TYPE_DEFAULT,
PERSISTENCE_TYPE_PRIVATE),
OriginScope::FromOrigin(mPrincipalMetadata.mOrigin),
Nullable<Client::Type>(),
/* aExclusive */ false);
@@ -2775,7 +2777,9 @@ RefPtr<BoolPromise> EstimateOp::OpenDirectory() {
// XXX In theory, we should be locking entire group, not just one origin.
return OpenStorageDirectory(
PersistenceScope::CreateFromValue(mOriginMetadata.mPersistenceType),
PersistenceScope::CreateFromSet(PERSISTENCE_TYPE_TEMPORARY,
PERSISTENCE_TYPE_DEFAULT,
PERSISTENCE_TYPE_PRIVATE),
OriginScope::FromOrigin(mOriginMetadata.mOrigin),
Nullable<Client::Type>(),
/* aExclusive */ false);