Closed Bug 1910848 Opened 9 months ago Closed 9 months ago

Rework QuotaManagerService methods for getting usage to use async messages with async responses

Categories

(Core :: Storage: Quota Manager, task, P2)

task

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: janv, Assigned: janv)

References

Details

Attachments

(22 files)

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

The main goal is the ability to get usages asynchronously without using IPC, so it can be easily used in gtests.
This bug also covers some related refactorings, code modernization and cleanup.

Multiple helper classes will need to call this method.

This is one of the things which are needed for making GetUsageOp and
GetOriginUsageOp independent from the actor. In practise, for changing the main
base class of the operations from QuotaUsageRequestBase to
ResolvableNormalOriginOp.

ResolvableNormalOriginOp::SendResults currently doesn't check the mCanceled
flag despite that it inherits from NormalOriginOperationBase which allows
setting mCanceled to true.

See Also: → 1910875
Keywords: leave-open
See Also: → 1911030

OriginOperationBase is finally fully abstract.

The class which implements the protocol is already refcounted, but the
interaction with IPC still uses manual deallocation.

This is a prerequisite to make GetUsageOp independent from the actor.

This will allow to include QuotaCommon.h in header files less often.

It's now also possible to define callbacks for move-only types.

This test is needed for making sure that upcoming refactoring doesn't regress
getting origin usage, especially the cancelling of requests.

Sub actors are still created, but their only purpose is to allow cancellation
of alreaady created requests. Actual results are now returned as asynchronous
responses to the asynchronous messages.

PQuotaUsageRequest is now only used for cancellation of requests, constructed
using managed endpoints.

Actual results are now returned as asynchronous responses to the asynchronous
messages.

CanSend can be used instead of custom tracking of the actor state.

The class is not used as a base for other classes anymore.

Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/72b53501cca5 Pull out TraverseRepositoryHelper::GetIsCanceledFlag method into a new base class; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/5d8fd18370e7 Pull out GetUsageForOrigin and GetUsageForOriginEntries methods from QuotaUsageRequestBase into a new base class; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/08be1ab6e06c Align QuotaUsageRequestBase::SendResults and ResolvableNormalOriginOp::SendResults; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/b9dd09204dc4 Encapsulate NormalOriginOperationBase::mCanceled; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/e3de2b0a2e0f Pull out OriginOperationBase::mActorDestroyed to actor classes; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/939d52810d28 Make PQuotaUsageRequest protocol refcounted; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/eda61190c54b Replace custom OriginUsage with a common OriginUsageMetadata struct; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/ca7aa8c8e72a Move BackgroundThreadObject to separate files; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/0b0b31a5f645 Make it easy to define new ResponsePromiseResolveOrRejectCallback based types; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/59ca51a26b82 Make it easy to define new PromiseResolveOrRejectCallback based callbacks; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/1aeb44dece37 Make it possible to use ResolvableNormalOriginOp with move-only types; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/e5b7405feb4e Add a test for nsIQuotaManagerService::GetUsageForPrincipal; r=hsingh https://hg.mozilla.org/integration/autoland/rev/ac5c4d9fb58b Convert test_getUsage.js from using generator functions to using async functions instead; r=dom-storage-reviewers,hsingh,asuth https://hg.mozilla.org/integration/autoland/rev/0938096af589 Add support for pausing QM IO thread after finishing directory work; r=dom-storage-reviewers,hsingh,asuth https://hg.mozilla.org/integration/autoland/rev/3567287b0cb3 Add testing for nsIQuotaUsageRequest.cancel(); r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/6a3e71fe97e7 Rework QuotaManagerService methods for getting usage to use async messages with async responses; r=dom-storage-reviewers,jari
Keywords: leave-open
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a5ac64e161f5 Remove unused PQuotaUsageRequest constructor; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/a67df5b4972d Remove unused __delete__ argument; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/26144668242c Remove unneeded QuotaUsageRequestBase::mActorDestroyed flag; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/f79c7abbd765 Rename QuotaUsageRequestBase to QuotaUsageRequestParent; r=hsingh https://hg.mozilla.org/integration/autoland/rev/ce838f1d824b Move QuotaUsageRequestChild to separate files; r=dom-storage-reviewers,jari https://hg.mozilla.org/integration/autoland/rev/881e972d3b14 Switch PQuotaUsageRequest to non-virtual implementation; r=dom-storage-reviewers,asuth
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: