Closed Bug 1619592 Opened 5 years ago Closed 4 years ago

Get rid of QuotaManager::EnsureStorageAndOriginIsInitialized

Categories

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

task

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 2 open bugs)

Details

Attachments

(15 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
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

This method currently ensures that storage, temporary storage and the origin is initialized. However, for example LSNG needs more fine grained work flow and when there's no localStorage data for given origin it just makes sure storage and temporary storage is initialized. The origin is initialized later when we actually need to flush data to disk.
Also, by forcing quota clients to call individual methods, it will be slightly more visible when one of these methods fail and also what is actually happening/what needs to be initialized.

This is also needed for converting test_unknownFiles.js to the new declarative testing infrastructure.

Blocks: 1620277
No longer blocks: 1482662

All initialization related operations, the clear all operation and reset
operations now fail if storage is not initialized.
All other operations make sure storage is initialized by setting the
mNeedsStorageInit flag. DirectoryWork() for these operations now assert that
storage is initialized.
The aResetAll param has been removed from resetStoragesForPrincipal since
there's no use case for it right now (if there's a use case for it in future,
it should be handled by a separate method like clearOriginsByPrefix).
This patch also separates ResetOriginOp from ClearOriginOp for better
readibility of code.

EnsureStorageAndOriginIsInitialized has been replaced with:
EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized.
Both methods require initialized storage via EnsureStorageIsInitialized.
EnsureTemporaryOriginIsInitialized additionally requries initialized temporary
storage via EnsureTemporaryStorageIsInitialized.

Attachment #9132205 - Attachment is obsolete: true
Keywords: leave-open
Pushed by shindli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/50af9d58c645 Rationalize PersistenceTypeTo* and PersistenceTypeFrom* methods; r=dom-workers-and-storage-reviewers,sg
Backout by shindli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/24cc377eedd8 Backed out changeset 50af9d58c645 for causing build bustages in /builds/worker/checkouts/gecko/dom/quota/PersistenceType.cpp CLOSED TREE
Pushed by rgurzau@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6567a3000e96 Rationalize PersistenceTypeTo* and PersistenceTypeFrom* methods; r=dom-workers-and-storage-reviewers,sg

ResetOriginOp has been separated from ClearOriginOp for better readibility of
code.

The aResetAll param has been removed from resetStoragesForPrincipal since
there's no use case for it right now (if there's a use case for it in future, it
should be handled by a separate method like resetOriginsByPrefix).

Attachment #9133528 - Attachment description: Bug 1619592 - Add and use IsValidPersistenceType method; r=dom-workers-and-storage-reviewers → Bug 1619592 - Add and use IsValidPersistenceType method; r=#dom-workers-and-storage-reviewers
Attachment #9133529 - Attachment description: Bug 1619592 - Add and use Client::IsValidType method; r=dom-workers-and-storage-reviewers → Bug 1619592 - Add and use Client::IsValidType method; r=#dom-workers-and-storage-reviewers
Attachment #9133530 - Attachment description: Bug 1619592 - Separate ResetOriginOp from ClearOriginOp; r=dom-workers-and-storage-reviewers → Bug 1619592 - Separate ResetOriginOp from ClearOriginOp; r=#dom-workers-and-storage-reviewers
Attachment #9133532 - Attachment description: Bug 1619592 - Remove aResetAll param from nsIQuotaManagerService::ResetStoragesForPrincipal; r=dom-workers-and-storage-reviewers → Bug 1619592 - Remove aResetAll param from nsIQuotaManagerService::ResetStoragesForPrincipal; r=#dom-workers-and-storage-reviewers
Attachment #9131826 - Attachment description: Bug 1619592 - Update selected operations to not implicitly initialize storage; r=dom-workers-and-storage-reviewers → Bug 1619592 - Update selected operations to not implicitly initialize storage; r=#dom-workers-and-storage-reviewers
Attachment #9133528 - Attachment description: Bug 1619592 - Add and use IsValidPersistenceType method; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Refactor persistence type checks using new IsValidPersistenceType method; r=#dom-workers-and-storage-reviewers
Attachment #9133529 - Attachment description: Bug 1619592 - Add and use Client::IsValidType method; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Refactor client type checks using new Client::IsValidType method; r=#dom-workers-and-storage-reviewers
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d749e4d81c35 Refactor persistence type checks using new IsValidPersistenceType method; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/c5b818f1397c Refactor client type checks using new Client::IsValidType method; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/c6f81e43e149 Separate ResetOriginOp from ClearOriginOp; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/31ada6206090 Remove aResetAll param from nsIQuotaManagerService::ResetStoragesForPrincipal; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/afa84f8037a5 Update selected operations to not implicitly initialize storage; r=dom-workers-and-storage-reviewers,sg
Severity: normal → S3
Flags: needinfo?(jvarga)
Severity: S3 → S4
Attachment #9131827 - Attachment description: Bug 1619592 - Get rid of QuotaManager::EnsureStorageAndOriginIsInitialized; r=dom-workers-and-storage-reviewers → Bug 1619592 - Get rid of QuotaManager::EnsureStorageAndOriginIsInitialized; r=#dom-workers-and-storage-reviewers
Blocks: 1671932
Attachment #9131827 - Attachment description: Bug 1619592 - Get rid of QuotaManager::EnsureStorageAndOriginIsInitialized; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Remove unused EnsureStorageAndOriginIsInitialized method; r=#dom-workers-and-storage-reviewers
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4c33d91bff7d Remove unused aClientType argument in EnsureStorageAndOriginIsInitialized; r=dom-workers-and-storage-reviewers,sg
Attachment #9188217 - Attachment description: Bug 1619592 - Convert EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized to use mozilla::Result and QM_TRY; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Convert EnsureDirectory, EnsureOriginDirectory, EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized to use mozilla::Result and QM_TRY; r=#dom-workers-and-storage-reviewers
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e8572b4f56f Convert EnsureDirectory, EnsureOriginDirectory, EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized to use mozilla::Result and QM_TRY; r=dom-workers-and-storage-reviewers,sg
Attachment #9188221 - Attachment description: Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsureTemporaryOriginIsInitiaized in dom/cache; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsureTemporaryOriginIsInitialized in dom/cache; r=#dom-workers-and-storage-reviewers
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8db250609526 Add initializePersistentOrigin and initializeTemporaryOrigin to nsIQuotaManagerService; r=dom-workers-and-storage-reviewers,sg
Attachment #9188219 - Attachment description: Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistenOriginIsInitialized and EnsureTemporaryOriginIsInitiaized in dom/quota; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistenOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/quota; r=#dom-workers-and-storage-reviewers
Attachment #9188220 - Attachment description: Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistenOriginIsInitialized and EnsureTemporaryOriginIsInitiaized in dom/indexedDB; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistenOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/indexedDB; r=#dom-workers-and-storage-reviewers
Attachment #9188219 - Attachment description: Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistenOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/quota; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/quota; r=#dom-workers-and-storage-reviewers
Attachment #9188220 - Attachment description: Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistenOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/indexedDB; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/indexedDB; r=#dom-workers-and-storage-reviewers
Attachment #9188222 - Attachment description: Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistenOriginIsInitialized and EnsureTemporaryOriginIsInitiaized in dom/simpledb; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/simpledb; r=#dom-workers-and-storage-reviewers
Attachment #9188223 - Attachment description: Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsureTemporaryOriginIsInitiaized in dom/localstorage; r=#dom-workers-and-storage-reviewers → Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsureTemporaryOriginIsInitialized in dom/localstorage; r=#dom-workers-and-storage-reviewers
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d4e713da4380 Replace EnsureStorageAndOriginIsInitialized with EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/quota; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/e16ce60b0942 Replace EnsureStorageAndOriginIsInitialized with EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/indexedDB; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/61d0d2245183 Replace EnsureStorageAndOriginIsInitialized with EnsureTemporaryOriginIsInitialized in dom/cache; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/056fd84bddfb Replace EnsureStorageAndOriginIsInitialized with EnsurePersistentOriginIsInitialized and EnsureTemporaryOriginIsInitialized in dom/simpledb; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/a515433c3eb8 Replace EnsureStorageAndOriginIsInitialized with EnsureTemporaryOriginIsInitialized in dom/localstorage; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/01623709adc4 Remove unused EnsureStorageAndOriginIsInitialized method; r=dom-workers-and-storage-reviewers,sg
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: