Cover origin initialization in OpenStorageDirectory and OpenClientDirectory
Categories
(Core :: Storage: Quota Manager, task, P1)
Tracking
()
People
(Reporter: janv, Assigned: janv)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Attachments
(26 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 | |
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 |
Quota clients and origin operations currently still have to call EnsurePersistentOriginIsInitializedInternal
or EnsureTemporaryOriginIsInitializedInternal
method on the QM IO thread. This should be covered by OpenStorageDirectory and OpenClientDirectory instead.
Assignee | ||
Comment 1•7 months ago
|
||
Client storages can be currently cleared by using the optional argument of
nsIQuotaManagerService::ClearStoragesForPrincipal. However, supporting clearing
storages for both a principal and a client is not ideal for several reasons.
Clearing of origins will have to unset some flags which is problematic when
a client type is specified and clearing of clients will eventually need to
unset some other flags as well.
Depends on D195400
Assignee | ||
Comment 2•7 months ago
|
||
Depends on D195400
Assignee | ||
Comment 3•7 months ago
|
||
There's now a dedicated nsIQuotaManagerService::ClearStoragesForClient method
for clearing storages by client type. All callers of
nsIQuotaManagerService::ClearStoragesForPrincipal which want to clear storages
for a specific client only can be now converted to call the new method.
Depends on D195403
Assignee | ||
Comment 4•7 months ago
|
||
Depends on D195504
Assignee | ||
Comment 5•7 months ago
|
||
A sub actor is no longer created. Actual result is now returned as
an asynchronous response to an asynchronous message.
Depends on D195505
Assignee | ||
Comment 6•7 months ago
|
||
Client storages can be currently reset by using the optional argument of
nsIQuotaManagerService::ResetStoragesForPrincipal. However, supporting
resetting storages for both a principal and a client is not ideal for several
reasons. Resetting of origins will have to unset some flags which is
problematic when a client type is specified and resetting of clients will
eventually need to unset some other flags as well.
Depends on D195507
Assignee | ||
Comment 7•7 months ago
|
||
There's now a dedicated nsIQuotaManagerService::ResetStoragesForClient method
for resetting storages by client type. All callers of
nsIQuotaManagerService::ResetStoragesForPrincipal which want to reset storages
for a specific client only can be now converted to call the new method.
Depends on D195508
Assignee | ||
Comment 8•7 months ago
|
||
Depends on D195509
Assignee | ||
Comment 9•7 months ago
|
||
This is a preparation for unsetting some flags when origins are either cleared
or reset.
Depends on D195510
Assignee | ||
Comment 10•7 months ago
|
||
This additional testing infrastructure is needed for verifying origin
initialization status.
Depends on D195522
Assignee | ||
Comment 11•7 months ago
|
||
This removes some code duplication, but the primary motivation is to use it for
a member variable declaration in QuotaManager.h
Depends on D195526
Assignee | ||
Comment 12•7 months ago
|
||
Origin initialization tracking on the owning thread is needed for covering
origin initialization in QuotaManager::OpenClientDirectory.
Depends on D195532
Assignee | ||
Comment 13•7 months ago
|
||
The new category is needed for implementing an optimization in
QuotaManager::InitializePersistentOrigin,
QuotaManager::InitializeTemporaryOrigin and
QuotaManager::OpenClientDirectory to avoid creating a new origin initialization
operations when a given origin is already initialized.
Depends on D195535
Assignee | ||
Comment 14•7 months ago
|
||
It's now possible to check if an origin is already initialized on the owning
thread and it's also possible to evaluate existing directory locks if there are
any uninit origin operations pending. So we can add optimizations to origin
initialization methods to resolve promises immediately if origins are already
initialized and there are no pending uninit storage or uninit origin operations.
Depends on D195543
Assignee | ||
Comment 15•7 months ago
|
||
LSNG already uses some QuotaManager APIs to achieve that origin directories are
not created if they don't exist during datastore preparation, but the feature
is not easy to use and it's also not generalized enough for use in other quota
clients. Besides that, the way how it's currently done in LSNG complicates
removal of QuotaManager::EnsureTemporaryOriginIsInitializedInternal calls from
LSNG. This patch is about generalizing of the feature, making it available to
all quota clients.
Depends on D195548
Assignee | ||
Comment 16•7 months ago
|
||
Depends on D195551
Assignee | ||
Comment 17•7 months ago
|
||
QuotaManager::OpenClientDirectory can now get initialization status of
corresponding origin and initialize the origin if it's needed.
Depends on D195570
Assignee | ||
Comment 18•7 months ago
|
||
QuotaManager::OpenClientDirectory already makes sure that corresponding origin
is initialized so all places where a client directory lock is obtained in such
way can start using QuotaManager::GetOrCreateOriginDirectory instead of
QuotaManager::Ensure(Persistent|Temporary)OriginIsInitializedInternal.
Depends on D195582
Assignee | ||
Comment 19•7 months ago
|
||
IndexedDB still calls QuotaManager::EnsurePersistentOriginIsInitializedInternal
from its idle database maintenance. However, we want to get rid of that so the
method can be made private. The idle database maintenance should only rely on
QuotaManager::OpenStorageDirectory method to do all necessary initialization.
Before we can do that, we need a method dedicated for initialization of entire
persistent storage.
Depends on D195589
Assignee | ||
Comment 20•7 months ago
|
||
QuotaManager::OpenStorageDirectory can now detect the requested persistence
scope and initialize persistent storage if it's needed.
Depends on D195653
Assignee | ||
Comment 21•7 months ago
|
||
QuotaManager::OpenStorageDirectory already makes sure that persistent storage
is initialized so this call is now redundant.
Depends on D195661
Assignee | ||
Comment 22•7 months ago
|
||
QuotaManager::Ensure(Persistent|Temporary)OriginIsInitializedInternal are now
called only from Initialize(Persistent|Temporary)OriginOp. It's now easy to
change the methods to be private methods.
Depends on D195665
Assignee | ||
Comment 23•7 months ago
|
||
The getter IsExtensionOrigin doesn't require the lock to be held, so the member
must be const.
Depends on D195548
Updated•7 months ago
|
Assignee | ||
Comment 24•6 months ago
|
||
If temporary storage is already initialized, we can use the cached value and
avoid reading it from the metadata file (which was used for loading the cached
value).
Depends on D196657
Assignee | ||
Comment 25•6 months ago
|
||
Currently, we call QuotaManager::PersistOrigin even when the origin was already
persisted. QuotaManager::PersistOrigin won't try to update the value again,
but it will have to do a hash lookup. We can easilly avoid this by calling
QuotaManager::PersistOrigin only when the value changed in the metadata file.
Depends on D198664
Assignee | ||
Comment 26•6 months ago
|
||
Currently, the cached value is updated before creation of the metadata file
which can lead to a mismatch between the metadata file and the cached value if
creation of the metadata file fails. It will be safer to update the cached
value only after successful creation of the metadata file.
Depends on D198668
Description
•