This changes a few IDs which have historically been 32-bit integers to
instead be 64-bit integers, reducing the chance of the value
overflowing.
Differential Revision: https://phabricator.services.mozilla.com/D250502
In modern C++, static constexpr member variables are automatically
inline (aka weak) so the template trick is not needed. This also avoid
duplication and reduces the amount of parsed code. No impact on
generated binary (actually: smaller debuginfo, close to identical
binary).
Differential Revision: https://phabricator.services.mozilla.com/D247825
Updates several tests to explicitly disable the quota info cache by setting
dom.quotaManager.loadQuotaFromCache to false.
These tests were previously relying on origin access time updates (which set
the "accessed" flag) to trigger full origin scans. This behavior was a side
effect rather than an intentional part of the test logic.
Disabling the quota info cache ensures these tests do not depend on unrelated
behavior and continue to pass even when access time updates are disabled via
the dom.quotaManager.temporaryStorage.updateOriginAccessTime pref.
This is a follow-up to the patch that added the pref for manual testing.
Differential Revision: https://phabricator.services.mozilla.com/D243784
Converts OpenClientDirectory to return ClientDirectoryLockHandle instead of
RefPtr<ClientDirectoryLock>, and updates all its callers accordingly.
ClientDirectoryLockHandle is a move-only RAII wrapper that ensures the lock
is automatically dropped when the handle goes out of scope. This simplifies
ownership semantics and aligns with diagnostic assertions that verify proper
lock dropping.
This patch finalizes the transition for quota clients to use
ClientDirectoryLockHandle instead of client directory locks directly.
Differential Revision: https://phabricator.services.mozilla.com/D243665
Having this method here means nsGlobalWindowInner needs to be included in a number
of bindings files, and doesn't make a lot of sense. This patch moves it to Cache
and CacheStorage (the latter being a wrapper around the former) to avoid extra
includes.
Differential Revision: https://phabricator.services.mozilla.com/D244443
BodyTraverseFile does an expensive directory traversal while we
basically already know, which files we want to delete and can construct
their paths directly from the id.
BodyTraverseFile's additional functionality of deleting folders or
orphaned temp files it encounters while traversing is not resembled
here and we expect the caller to know what should be deleted. However,
we do delete orphaned temp files matching any of the passed ids.
Differential Revision: https://phabricator.services.mozilla.com/D240733
We are able to remove ServiceWorkerVisible and instead use
ServiceWorkersEnabled in its place since we are no longer limiting
where ServiceWorker instances are exposed.
The correctness of ExtendableMessageEvent.source is addressed later in
the stack.
Although we enable skip-waiting-installed.https.html here, we also have
to make it expected it will sometimes fail due to an inherent IPC race;
bug 1926641 describes the situation.
Differential Revision: https://phabricator.services.mozilla.com/D180914
Consumers should include corresponding headers for concrete type instead. This
will be especially needed when there will be separate includes for different
types of locks.
Differential Revision: https://phabricator.services.mozilla.com/D214813
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::GetOriginDirectory instead of
QuotaManager::EnsurePersistentOriginIsInitializedInternal and
QuotaManager::GetOrCreateTemporaryOriginDirectory instead of
QuotaManager::EnsureTemporaryOriginIsInitializedInternal.
Differential Revision: https://phabricator.services.mozilla.com/D195589
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.
Differential Revision: https://phabricator.services.mozilla.com/D195551
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.
Differential Revision: https://phabricator.services.mozilla.com/D195551
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.
Differential Revision: https://phabricator.services.mozilla.com/D195509
QuotaManager::OpenClientDirectory already makes sure that temporary storage
is initialized so all these calls are now redundant.
Differential Revision: https://phabricator.services.mozilla.com/D195391
Cache implementation already handles directory locks invalidated during
database initialization by canceling corresponding QuotaInitRunnable, this
patch adds an extra check for that to Context::OnQuotaInit.
Differential Revision: https://phabricator.services.mozilla.com/D220451
Cache implementation already handles directory locks invalidated during
database initialization, but test_slowDatabaseInitialization.js still hangs.
The issue is that Context::CancelAll currently just clears all pending actions
if the state is STATE_CONTEXT_INIT (the promise for caches.open is never
resolved or rejected). Instead of just clearing pending actions, the pending
actions need to be completed first when QuotaInitRunnable is done and only then
cleared.
Differential Revision: https://phabricator.services.mozilla.com/D220263