Closed Bug 1641512 Opened 5 years ago Closed 5 years ago

Improve GetUsageForOrigin* functions

Categories

(Core :: Storage: Quota Manager, task)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: sg, Assigned: sg)

References

Details

Attachments

(9 files, 1 obsolete file)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

As a follow-up to the discussion in https://phabricator.services.mozilla.com/D77073#inline-446669, it should be checked whether the signature or the name of the GetUsageForOrigin* functions should be changed to either make it clearer that aUsageInfo is an input/output parameter or it should be made a return value instead. If functions remains that have it as an output parameter, it should by convention be made the last parameter.

At the moment, it actually is an input/output parameter when called from here: https://searchfox.org/mozilla-central/rev/bc3600def806859c31b2c7ac06e3d69271052a89/dom/quota/ActorsParent.cpp#9452

But it still is an option to change it to a return value, as the caller could do the aggregation without (significant) overhead due to the simple structure of UsageInfo.

Status: NEW → ASSIGNED
Attachment #9152713 - Attachment is obsolete: true
Keywords: leave-open
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6d874119c61a Remove unused UsageInfo::DatabaseUsage function. r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/658679696de7 Remove unused include directive. r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/8ffee7c15658 Introduce Usage type with operator+/+=. r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/4353acf31e97 Rename AppendTo*Usage methods to Increment*Usage. r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/44c20d8025ec Replace Append method by operator+=. r=dom-workers-and-storage-reviewers,janv
Keywords: leave-open
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/12914ebfe67b Use Result<UsageInfo, nsresult> as return type of GetUsageForOrigin. r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/ead91a5bb878 Use Result<UsageInfo, nsresult> as return type of InitOrigin and add separate InitOriginWithoutTracking. r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/cb9be96d5643 Use Result<UsageInfo, nsresult> as return type of GetUsageForOriginInternal. r=dom-workers-and-storage-reviewers,janv https://hg.mozilla.org/integration/autoland/rev/79252915f36f Use distinct types for file and database usage. r=dom-workers-and-storage-reviewers,janv
See Also: → 1649503
Regressions: 1649503
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: