Besides reintroducing synchronous GetOrCreate, both GetOrCreate methods now
allow subsequent attempts to create QuotaManager if previous attemts failed
(only the first attempt was allowed before).
Differential Revision: https://phabricator.services.mozilla.com/D103881
Callers of these functions have been changed to call
GetDirectoryMetadataWithQuotaInfo2 and
GetDirectoryMetadataWithQuotaInfo2WithRestore instead which fully load the
metadata file.
Differential Revision: https://phabricator.services.mozilla.com/D101364
Instead of collection both origins exceeding their group limit and the global
limit before clearing any origin, do that separately. This removes the need
to adjust the global usage while determining which origins to evict simulating
the effects of evicting the origins exceeding their group limit.
This requires moving the lock into the GetOrigin* functions (thus removing
"Locked" from their names). Also, the arguments to GetOriginInfosExceedingGlobalLimit
are removed.
As an effect, the predicate passed into MaybeInsertOriginInfos is the same in
both uses, and just checks the IsPersisted property, so the predicate argument
is removed and the function is renamed to MaybeInsertNonPersistedOriginInfos.
Differential Revision: https://phabricator.services.mozilla.com/D103629
Instead of inserting all elements into OriginInfo array, and then removing
or skipping irrelevant entries, only insert the relevant ones in the first
place, using a new utility function template MaybeAppendOriginInfos.
Sort them by in least-recently used order according to the access timestamp.
Iterate over them to identify the threshold.
Finally, truncate the array to the threshold position.
Differential Revision: https://phabricator.services.mozilla.com/D101146
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins
Differential Revision: https://phabricator.services.mozilla.com/D101145
Instead of collection both origins exceeding their group limit and the global
limit before clearing any origin, do that separately. This removes the need
to adjust the global usage while determining which origins to evict simulating
the effects of evicting the origins exceeding their group limit.
This requires moving the lock into the GetOrigin* functions (thus removing
"Locked" from their names). Also, the arguments to GetOriginInfosExceedingGlobalLimit
are removed.
As an effect, the predicate passed into MaybeInsertOriginInfos is the same in
both uses, and just checks the IsPersisted property, so the predicate argument
is removed and the function is renamed to MaybeInsertNonPersistedOriginInfos.
Differential Revision: https://phabricator.services.mozilla.com/D103629
Instead of inserting all elements into OriginInfo array, and then removing
or skipping irrelevant entries, only insert the relevant ones in the first
place, using a new utility function template MaybeAppendOriginInfos.
Sort them by in least-recently used order according to the access timestamp.
Iterate over them to identify the threshold.
Finally, truncate the array to the threshold position.
Differential Revision: https://phabricator.services.mozilla.com/D101146
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins
Differential Revision: https://phabricator.services.mozilla.com/D101145
Instead of inserting all elements into OriginInfo array, and then removing
or skipping irrelevant entries, only insert the relevant ones in the first
place, using a new utility function template MaybeAppendOriginInfos.
Sort them by in least-recently used order according to the access timestamp.
Iterate over them to identify the threshold.
Finally, truncate the array to the threshold position.
Differential Revision: https://phabricator.services.mozilla.com/D101146
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins
Differential Revision: https://phabricator.services.mozilla.com/D101145
Instead of inserting all elements into OriginInfo array, and then removing
or skipping irrelevant entries, only insert the relevant ones in the first
place, using a new utility function template MaybeAppendOriginInfos.
Sort them by in least-recently used order according to the access timestamp.
Iterate over them to identify the threshold.
Finally, truncate the array to the threshold position.
Differential Revision: https://phabricator.services.mozilla.com/D101146
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins
Differential Revision: https://phabricator.services.mozilla.com/D101145
Instead of inserting all elements into OriginInfo array, and then removing
or skipping irrelevant entries, only insert the relevant ones in the first
place, using a new utility function template MaybeAppendOriginInfos.
Sort them by in least-recently used order according to the access timestamp.
Iterate over them to identify the threshold.
Finally, truncate the array to the threshold position.
Differential Revision: https://phabricator.services.mozilla.com/D101146
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins
Differential Revision: https://phabricator.services.mozilla.com/D101145