Граф коммитов

251 Коммитов

Автор SHA1 Сообщение Дата
Jan Varga eb2d4109e9 Bug 1734151 - Add MaybeRecordQuotaManagerShutdownStepWith and use it in cases when the string must be dynamically generated; r=hxu
Differential Revision: https://phabricator.services.mozilla.com/D127548
2021-10-12 12:29:43 +00:00
Jan Varga 53d543c18f Bug 1734151 - Move the shutdown started check into public methods for shutdown step recording; r=hxu
This will allow to add a method like MaybeRecordQuotaManagerShutdownStepWith
which will take a function for generating the string.

Differential Revision: https://phabricator.services.mozilla.com/D127545
2021-10-12 12:29:42 +00:00
Jan Varga a294b48418 Bug 1722668 - Implement nsIQuotaManagerService::getFullOriginMetadata; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D125168
2021-09-22 19:08:33 +00:00
Jan Varga 7d0fd78cda Bug 1722668 - Speed up temporary storage initialization by archiving unaccessed origin directories; r=jari
This patch introduces a new notion of unaccessed origins. An origin is
considered as unaccessed if its age is older than a threshold (controlled by a
new preference, currently set to 13 months). Unaccessed origins are collected
during quota info loading.
When quota info loading is finished we check if it took a long time (controlled
by a new preference, currently set to 21s) and eventually archive unaccessed
origins which should speed up temporary storage initialization in a new
session.
Archiving consits of creating a new directory (archive) under storage/archives/0
directory (the name is based on the current date) and moving unaccessed origin
directories to the archive.
Once the patch lands, we will be monitoring QM_QUOTA_INFO_LOAD_TIME_V0
telemetry (quota info load time) and eventually lower down the preference for
long quota info load time.
If there are no issues, the archiving will be replaced with a hard removal of
unaccessed origins and also of the archives which were created in the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D123049
2021-09-04 21:54:53 +00:00
Csoregi Natalia 03b44ad93d Backed out 3 changesets (bug 1722668) for failures on test_unsetLastAccessTime.js. CLOSED TREE
Backed out changeset db05822c64ff (bug 1722668)
Backed out changeset c9f100cb3f86 (bug 1722668)
Backed out changeset a7179b67eb1a (bug 1722668)
2021-09-05 00:22:49 +03:00
Jan Varga 127496a5fe Bug 1722668 - Speed up temporary storage initialization by archiving unaccessed origin directories; r=jari
This patch introduces a new notion of unaccessed origins. An origin is
considered as unaccessed if its age is older than a threshold (controlled by a
new preference, currently set to 13 months). Unaccessed origins are collected
during quota info loading.
When quota info loading is finished we check if it took a long time (controlled
by a new preference, currently set to 21s) and eventually archive unaccessed
origins which should speed up temporary storage initialization in a new
session.
Archiving consits of creating a new directory (archive) under storage/archives/0
directory (the name is based on the current date) and moving unaccessed origin
directories to the archive.
Once the patch lands, we will be monitoring QM_QUOTA_INFO_LOAD_TIME_V0
telemetry (quota info load time) and eventually lower down the preference for
long quota info load time.
If there are no issues, the archiving will be replaced with a hard removal of
unaccessed origins and also of the archives which were created in the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D123049
2021-09-04 20:10:13 +00:00
Jan Varga 4ad6f0533e Bug 1724895 - QM: Introduce type alias for Result<Ok, QMResult>; r=jari
This patch introduces a new type alias OkOrErr for Result<Ok, QMResult> and also converts some existing occurencies of Result<Ok, QMResult> to OkOrErr.

Differential Revision: https://phabricator.services.mozilla.com/D122206
2021-08-10 13:59:04 +00:00
Jan Varga 226a68d16d Bug 1718197 - Have a way to set QM_TRY context in ExecuteInitialization; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D118808
2021-07-31 16:32:14 +00:00
Jan Varga a418c56853 Bug 1718197 - Simplify access to FirstInitializationAttempt objects in initialization functions; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D119389
2021-07-31 16:32:13 +00:00
Jan Varga e22168a74c Bug 1719281 - QM: Execute initializations in ExecuteInitialization() for real; r=dom-storage-reviewers,asuth
ExecuteInitialization now takes a function argument instead of nsresult so
initializations are executed in the context of ExecuteInitialization. This
patch also removes a temporary overload of ExecuteInitialization.

Differential Revision: https://phabricator.services.mozilla.com/D119263
2021-07-31 12:37:36 +00:00
Jan Varga f269c78d92 Bug 1719281 - QM: Add a generic wrapper for running initializations; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D119182
2021-07-31 12:37:36 +00:00
Sandor Molnar 01917ee5ce Backed out 2 changesets (bug 1719281) for causing bc failures in FirstInitializationAttempts. CLOSED TREE
Backed out changeset 58b39579def6 (bug 1719281)
Backed out changeset d6801824d47d (bug 1719281)
2021-07-30 21:53:23 +03:00
Jan Varga 107d5083bc Bug 1719281 - QM: Execute initializations in ExecuteInitialization() for real; r=dom-storage-reviewers,asuth
ExecuteInitialization now takes a function argument instead of nsresult so
initializations are executed in the context of ExecuteInitialization. This
patch also removes a temporary overload of ExecuteInitialization.

Differential Revision: https://phabricator.services.mozilla.com/D119263
2021-07-30 17:51:58 +00:00
Jan Varga 3a089efdf2 Bug 1719281 - QM: Add a generic wrapper for running initializations; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D119182
2021-07-30 17:51:58 +00:00
Jan Varga 614eb7e4fe Bug 1716568 - Add support for origin based first initialization attempts handling to InitializationInfo; r=dom-storage-reviewers,asuth
The existing custom implementation of origin based first initialization
attempts handling has been replaced with the new generic implementation.

Differential Revision: https://phabricator.services.mozilla.com/D118141
2021-06-23 21:26:10 +00:00
Jens Stutte 61d67b9ff0 Bug 1706998: Replace QuotaManager::GetRef().MaybeRecordShutdownStep by static QuotaManager::(Safe)MaybeRecordQuotaClientShutdownStep; r=dom-storage-reviewers,janv
There are some few unsafe uses of MaybeRecordShutdownStep where the QuotaManager singleton may be  not (yet or anymore) alive.
In order to not add many unnecessary null checks, we drop GetRef and MaybeRecordShutdownStep in favor of
QuotaManager::MaybeRecordQuotaClientShutdownStep
QuotaManager::SafeMaybeRecordQuotaClientShutdownStep
with the sole difference that the Safe variant runtime checks the singleton, while the normal one only asserts.

Differential Revision: https://phabricator.services.mozilla.com/D115988
2021-05-28 06:46:04 +00:00
Jan Varga 1afda44bfb Bug 1709352 - Support error stacks only in EARLY_BETA_OR_EARLIER) || DEBUG builds; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D114736
2021-05-25 09:06:11 +00:00
Jan Varga 159ef171f9 Bug 1709352 - Convert MaybeRemoveLocalStorageArchiveTmpFile to return Result<Ok, QMResult>; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D114245
2021-05-25 07:28:21 +00:00
Jan Varga c546aae9a0 Bug 1697115 - Rationalize QuotaManager::ResetUsageForClient arguments; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107616
2021-03-17 06:56:39 +00:00
Jan Varga b59182de8d Bug 1697115 - Rationalize QuotaManager::DecreaseUsageForClient arguments; r=dom-storage-reviewers,sg
Note that the method DecreaseUsageForOrigin has been renamed to
DecreaseUsageForClient.

Differential Revision: https://phabricator.services.mozilla.com/D107615
2021-03-17 06:56:39 +00:00
Jan Varga de33fe2cf6 Bug 1697115 - Rationalize QuotaManager::NoteOriginDirectoryCreated arguments and return type; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107614
2021-03-17 06:56:39 +00:00
Jan Varga ebce7d3ac8 Bug 1697115 - Rationalize QuotaManager::EnsureQuotaForOrigin arguments; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107612
2021-03-17 06:56:38 +00:00
Jan Varga d45596dcf0 Bug 1697115 - Rationalize QuotaManager::InitQuotaForOrigin arguments; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107611
2021-03-17 06:56:38 +00:00
Jan Varga 1cc0ba995e Bug 1686031 - Rename OriginMetadata.h to CommonMetadata.h; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107608
2021-03-11 05:53:17 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Jan Varga 28b36c6c8c Bug 1686031 - Rename GetDirectoryMetadataWithOriginMetadata2 to LoadFullOriginMetadata and GetDirectoryMetadataWithOriginMetadata2WithRestore to LoadFullOriginMetadataWithRestore; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107607
2021-03-10 08:34:53 +00:00
Jan Varga 591e53a104 Bug 1686031 - Replace GetDirectoryResultWithOriginMetadata with FullOriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107605
2021-03-10 08:34:52 +00:00
Jan Varga c6a31f1fb9 Bug 1686031 - Fix storage upgrades and restoration of the metadata file to use proper persistence type internally; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106907
2021-03-10 05:53:03 +00:00
Alexandru Michis 06f97bce8a Backed out 4 changesets (bug 1695906, bug 1686031) for causing bustages in ActorsParent.cpp
CLOSED TREE

Backed out changeset 43a39c491548 (bug 1686031)
Backed out changeset 9be2fd0b5b6a (bug 1686031)
Backed out changeset f483f50d292a (bug 1695906)
Backed out changeset 470d617d7673 (bug 1686031)
2021-03-09 23:06:01 +02:00
Jan Varga c9519afc4d Bug 1686031 - Rename GetDirectoryMetadataWithOriginMetadata2 to LoadFullOriginMetadata and GetDirectoryMetadataWithOriginMetadata2WithRestore to LoadFullOriginMetadataWithRestore; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107607
2021-03-09 19:02:00 +00:00
Jan Varga ad621c19e4 Bug 1686031 - Replace GetDirectoryResultWithOriginMetadata with FullOriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D107605
2021-03-09 19:02:00 +00:00
Jan Varga e6de9b6ac0 Bug 1686031 - Fix storage upgrades and restoration of the metadata file to use proper persistence type internally; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106907
2021-03-09 19:01:59 +00:00
Jan Varga 778be94ce4 Bug 1686031 - Fix GetDirectoryMetadataWithOriginMetadata2 and GetDirectoryMetadataWithOriginMetadata2WithRestore to return proper persistence type; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D106906
2021-03-05 04:48:38 +00:00
Jan Varga 52647a0d1e Bug 1686031 - Add mPersistenceType to OriginMetadata; r=dom-storage-reviewers,sg
The existing members of OriginMetadata have been extracted to a parent struct
called PrincipalMetadata. Methods like GetOriginUsage,
GetInfoFromValidatedPrincipalInfo, GetInfoFromPrincipal and GetInfoForChrome
have been changed to take/return PrincipalMetadata instead of OriginMetadata.
Having the persistence type doesn't make sense in those methods because the
origin is not tied to a specific persistence type in context of the methods.

Some places temporarily pass PERSISTENCE_TYPE_INVALID and will be fixed in
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D106400
2021-03-04 18:03:02 +00:00
Jan Varga 37dd4a946c Bug 1686031 - Add suffix to OriginInfoPair and quota info cache; r=dom-storage-reviewers,sg
This fixes the two spots where we were always passing an empty suffix to
OriginMetadata.

Differential Revision: https://phabricator.services.mozilla.com/D106131
2021-03-04 11:07:39 +00:00
Simon Giesecke e740cbc60f Bug 1689680 - Do fallback from existing archive file to webapps store file to empty file more consistently. r=dom-storage-reviewers,ttung
Includes an amendment by janv.

Differential Revision: https://phabricator.services.mozilla.com/D105032
2021-02-17 16:41:08 +00:00
Jan Varga 832c277718 Bug 1686031 - Fold QuotaInfo into OriginMetadata and rename QuotaInfo.h to OriginMetadata.h; r=dom-storage-reviewers,sg
Existing uses of OriginMetadata (with only mGroup and mOrigin) have been
adapted and they now always initialize mSuffix to an empty string.
Following patches will change it to real suffix if there's any.

Differential Revision: https://phabricator.services.mozilla.com/D104971
2021-02-12 21:43:42 +00:00
Jan Varga 4323e6df02 Bug 1686031 - Rename GroupAndOrigin to OriginMetadata; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104970
2021-02-12 14:03:28 +00:00
Jan Varga eee089ae3d Bug 1690025 - Split public DirectoryLock class into a hierarchy of public classes; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104360
2021-02-09 15:01:54 +00:00
Jan Varga 9e117b1b8d Bug 1690025 - Move DirectoryLock class to a separate file; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104154
2021-02-09 10:42:22 +00:00
Jan Varga affc82c199 Bug 1690025 - Create directory locks using factories defined on DirectoryLockImpl class; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104147
2021-02-09 08:30:30 +00:00
Butkovits Atila 7ab6339085 Backed out 3 changesets (bug 1690025) for causing failure on Client.h. CLOSED TREE
Backed out changeset 5d5e90d31294 (bug 1690025)
Backed out changeset d2b39aebfad2 (bug 1690025)
Backed out changeset 2684aad61a6b (bug 1690025)
2021-02-09 10:12:28 +02:00
Jan Varga dcca4eaf0c Bug 1690025 - Move DirectoryLock class to a separate file; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104154
2021-02-09 06:52:57 +00:00
Jan Varga 9dfb414b4a Bug 1690025 - Create directory locks using factories defined on DirectoryLockImpl class; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D104147
2021-02-09 06:52:56 +00:00
Jan Varga c1cb6823e7 Bug 1690493 - Reintroduce synchronous QuotaManager::GetOrCreate; r=dom-workers-and-storage-reviewers,sg
Besides reintroducing synchronous GetOrCreate, both GetOrCreate methods now
allow subsequent attempts to create QuotaManager if previous attemts failed
(only the first attempt was allowed before).

Differential Revision: https://phabricator.services.mozilla.com/D103881
2021-02-09 05:30:57 +00:00
Jan Varga 6e427cfc3c Bug 1690275 - LSNG: Remove LSObject::GetSyncLoopEventTarget; r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D103791
2021-02-08 18:06:12 +00:00
Jan Varga 6a6a366031 Bug 1686031 - Remove QuotaManager::GetDirectoryMetadata2 and QuotaManager::GetDirectoryMetadata2WithRestore; r=dom-workers-and-storage-reviewers,sg
Callers of these functions have been changed to call
GetDirectoryMetadataWithQuotaInfo2 and
GetDirectoryMetadataWithQuotaInfo2WithRestore instead which fully load the
metadata file.

Differential Revision: https://phabricator.services.mozilla.com/D101364
2021-02-05 15:28:25 +00:00
Simon Giesecke 68963cb062 Bug 1685677 - Extract functions from EnsureStorageIsInitialized. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D101183
2021-02-05 16:17:47 +00:00
Jan Varga 9dead77e35 Bug 1690025 - Make all directory lock creating methods use a common internal method; r=dom-workers-and-storage-reviewers,sg
This is especially about changing CreateDirectoryLockForEviction to not create
a lock directly using MakeRefPtr.

Differential Revision: https://phabricator.services.mozilla.com/D103790
2021-02-03 11:14:42 +00:00
Simon Giesecke 1ba38f7421 Bug 1689967 - Simplify CleanupTemporaryStorage and the functions it calls. r=dom-workers-and-storage-reviewers,janv
Instead of collection both origins exceeding their group limit and the global
limit before clearing any origin, do that separately. This removes the need
to adjust the global usage while determining which origins to evict simulating
the effects of evicting the origins exceeding their group limit.

This requires moving the lock into the GetOrigin* functions (thus removing
"Locked" from their names). Also, the arguments to GetOriginInfosExceedingGlobalLimit
are removed.

As an effect, the predicate passed into MaybeInsertOriginInfos is the same in
both uses, and just checks the IsPersisted property, so the predicate argument
is removed and the function is renamed to MaybeInsertNonPersistedOriginInfos.

Differential Revision: https://phabricator.services.mozilla.com/D103629
2021-02-02 17:47:11 +00:00