Closed Bug 1689967 Opened 4 years ago Closed 4 years ago

Simplify QuotaManager::CleanupTemporaryStorage

Categories

(Core :: Storage: Quota Manager, task)

task

Tracking

()

RESOLVED FIXED
87 Branch
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());

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.

Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/129b45a961fb Simplify CleanupTemporaryStorage and the functions it calls. r=dom-workers-and-storage-reviewers,janv

Backed out along with Bug 1685677 for causing bustage on TestFlatten.cpp - see https://bugzilla.mozilla.org/show_bug.cgi?id=1685677#c17

Backout by ncsoregi@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/49fff125656d Backed out 5 changesets (bug 1689967, bug 1685677) for bustage on TestFlatten.cpp. CLOSED TREE
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/db5df9a01429 Simplify CleanupTemporaryStorage and the functions it calls. r=dom-workers-and-storage-reviewers,janv
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: