Simplify QuotaManager::CleanupTemporaryStorage
Categories
(Core :: Storage: Quota Manager, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: sg, Assigned: sg)
References
Details
Attachments
(1 file)
Currently, QuotaManager::CleanupTemporaryStorage
clears origins only after selecting both origins to evict because of exceeding their group limit as well as the global limit, which makes the second step quite complex, since it needs to adjust the usage values for the intended eviction of the first step. This was meant as an optimization, but, if it's an optimization at all, the effect is likely negligible. This could be simplified by doing just:
ClearOrigins(GetOriginInfosExceedingGroupLimit());
ClearOrigins(GetOriginInfosExceedingGlobalLimit());
Assignee | ||
Comment 1•4 years ago
|
||
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.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Backed out along with Bug 1685677 for causing bustage on TestFlatten.cpp - see https://bugzilla.mozilla.org/show_bug.cgi?id=1685677#c17
Comment 6•4 years ago
|
||
bugherder |
Description
•