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

328 Коммитов

Автор SHA1 Сообщение Дата
Jan Varga 6edcf204fd Bug 1686191 - Have a way to specifically report warnings around QM_TRY; r=asuth,sg,dom-storage-reviewers
This patch:
- adds QM_WARNONLY_TRY/QM_NOTEONLY_TRY macros
- adds QM_WARNONLY_TRY_UNWRAP/QM_NOTEONLY_TRY_UNWRAP macros
- adds QM_OR_ELSE_WARN/QM_OR_ELSE_NOTE sub macros
- replaces non-propagating uses of NS_WARNING with redundant messages by
  QM_WARNONLY_TRY
- replaces uses of QM_TRY with orElse by QM_TRY(QM_OR_ELSE_WARN(...))
- replaces uses of QM_TRY inside an extra lambda with QM_WARNONLY_TRY
- replaces uses of QM_TRY with QM_VOID with QM_WARNONLY_TRY.
- replaces uses of QM_TRY with unwanted warnings with QM_NOTEONLY_TRY
- replaces uses of QM_TRY with additional Maybe wrapping for doing a
  fallback with QM_TRY(QM_OR_ELSE_WARN(...))

Differential Revision: https://phabricator.services.mozilla.com/D108424
2021-03-24 04:40:10 +00:00
Simon Giesecke 11949c7259 Bug 708901 - Migrate to nsTHashSet in dom/localstorage. r=dom-storage-reviewers,janv
Depends on D108598

Differential Revision: https://phabricator.services.mozilla.com/D108599
2021-03-23 10:36:34 +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 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
Simon Giesecke 91fdeec18c Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 16:14:58 +00:00
Alexandru Michis c691800cb0 Backed out changeset fd03162e726d (bug 1695162) for causing bustages in Document.cpp
CLOSED TREE
2021-03-12 17:10:02 +02:00
Simon Giesecke 2fb6095f16 Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 14:54:08 +00:00
Simon Giesecke 77de1d90be Bug 1634281 - Use (STL) algorithms instead of custom hashtable iteration where possible in dom/localstorage. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D107679
2021-03-10 13:10:37 +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 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 eeb8cf2781 Bug 1695883 - Add explicit fallible mozStorageTransaction::Start method for starting the transaction; r=dom-storage-reviewers,sg
The new method is mandatory because mozStorageTransaction constructor no longer
starts the transaction. It must be started explicitely.

All consumers have been adjusted, but only dom/quota, dom/indexedDB, dom/cache,
dom/localstorage and dom/storage handle the error. Other components like
netwerk/cache, netwerk/cookie and toolkit/components currently only warn on
failure to start a transaction. Bug 1696129, 1696130 and 1696133 have been
filed for proper handling of transaction start failures in those components.

Differential Revision: https://phabricator.services.mozilla.com/D106893
2021-03-04 04:38:06 +00:00
Simon Giesecke 0b97035410 Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in dom/localstorage. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D106089
2021-03-01 09:59:31 +00:00
Simon Giesecke b399a8194c Bug 1691913 - Add some convenience methods to LookupResult and EntryHandle. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D105475
2021-03-01 09:59:29 +00:00
Simon Giesecke 0b443059fd Bug 1693306 - Simplify some uses of LookupOrInsertWith by GetOrInsertNew. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D105479
2021-02-26 09:22:54 +00:00
Simon Giesecke 9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke 4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Simon Giesecke d2caea36fa Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00
Simon Giesecke 661e25bf09 Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-16 15:53:33 +00:00
Simon Giesecke 767b2bb664 Bug 1689680 - Add StorageDBUpdater::CreateCurrentSchema and call that if we know we have a fresh database file. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D104716
2021-02-16 08:55:15 +00:00
Simon Giesecke 780a1636a9 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 15:12:17 +00:00
smolnar 1afbbe67e1 Backed out 5 changesets (bug 1691894) for causing hazard failures in nsXULPrototypeCache. CLOSED TREE
Backed out changeset 22dc870ee609 (bug 1691894)
Backed out changeset 58c31e9d6ae3 (bug 1691894)
Backed out changeset 7483e84149d8 (bug 1691894)
Backed out changeset f977d6cfa973 (bug 1691894)
Backed out changeset db4503476f34 (bug 1691894)
2021-02-15 16:43:23 +02:00
Simon Giesecke 3c29a68440 Bug 1691894 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-15 10:04:46 +00:00
Simon Giesecke 8973094ec1 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 10:04:45 +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
Simon Giesecke 4b754c2bfa Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in dom/localstorage. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D104194
2021-02-09 18:19:37 +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
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 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
Simon Giesecke 4c64631381 Bug 1687321 - Use GetDirEntryKind instead of IsDirectory when iterating over directory entries in dom/localstorage. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D103765
2021-02-08 13:25:44 +00:00
Simon Giesecke c1c05c7017 Bug 1690291 - Handle NS_ERROR_STORAGE_IOERR when opening a database like NS_ERROR_FILE_CORRUPTED. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D103898
2021-02-04 11:43:22 +00:00
Jan Varga a8d359bfc5 Bug 1689293 - Introduce DirectoryLock::Acquire; r=sg
Quota clients instead of doing:
RefPtr<DirectoryLock> pendingDirectoryLock = qm->OpenDirectory(..., listener);

now do:
RefPtr<DirectoryLock> directoryLock = qm->CreateDirectoryLock(...);
directoryLock->Acquire(listener);

Differential Revision: https://phabricator.services.mozilla.com/D103279
2021-02-02 08:20:18 +00:00
Jan Varga ccef31f31a Bug 1680275 - LSNG: Change gDatastores to use NotNull; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D99198
2021-01-28 21:24:40 +00:00
Simon Giesecke 286d06f727 Bug 1685111 - Use CachingDatabaseConnection in localstorage's Connection. r=dom-workers-and-storage-reviewers,asuth
Along with that, uses of LS_TRY are introduced with the new functions provided
by CachingDatabaseConnection.

This also renames the free IsOnConnectionThread/AssertIsOnConnectionThread
functions to IsOnGlobalConnectionThread/AssertIsOnGlobalConnectionThread
to resolve a naming conflict.

Differential Revision: https://phabricator.services.mozilla.com/D100924
2021-01-26 09:13:02 +00:00
Simon Giesecke 98a80aee92 Bug 1682536 - Use NotNull with WriteInfo. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D100091
2021-01-21 11:58:47 +00:00
Simon Giesecke 53647c7cbe Bug 1682536 - Use NotNull with Observer. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D100090
2021-01-21 11:58:44 +00:00
Simon Giesecke 1575347021 Bug 1685279 - Change QuotaManager::ParseOrigin to return a Result<PrincipalInfo, nsresult>. r=dom-workers-and-storage-reviewers,janv
ParseOrigin is only used to construct a PrincipalInfo, so it makes sense to
return it directly.

Differential Revision: https://phabricator.services.mozilla.com/D100889
2021-01-15 10:53:02 +00:00
Simon Giesecke 9d4e29c97f Bug 1685278 - Change GenerateOriginKey2 to return a Result. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D100888
2021-01-15 10:22:51 +00:00
Simon Giesecke e4626b49ec Bug 1685277 - Use QM_TRY in dom/localstorage/ActorsParent.cpp. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D100887
2021-01-15 10:51:28 +00:00
Simon Giesecke 20362b3c54 Bug 1684912 - Call a handler in case a corrupted database file was detected. r=dom-workers-and-storage-reviewers,janv
The handler is called before opening the connection again. This does not restore
the behaviour before Bug 1684912 exactly. In case removal of the usage or database
file fails, the handler will not be called. Also, the handler can no longer fail,
which simplifies the control flow.

Differential Revision: https://phabricator.services.mozilla.com/D100761
2021-01-15 10:51:15 +00:00
Simon Giesecke b3d468a5e8 Bug 1684854 - Consistently handle non-existence of usage file in QuotaClient::InitOrigin. r=dom-workers-and-storage-reviewers,janv
Specifically, do not attempt and fail removal of the usage file in
CreateStorageConnection if the usage file did not exist.

Differential Revision: https://phabricator.services.mozilla.com/D100675
2021-01-05 10:19:04 +00:00
Simon Giesecke aa680355aa Bug 1679540 - Extract CollectEachFile function and use in quota manager and clients. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D98075
2021-01-05 09:27:18 +00:00
Mihai Alexandru Michis a4520f52a9 Backed out changeset 9ef5f1fe26e8 (bug 1679540) for causing Bug 1683863. a=backout 2020-12-22 17:00:34 +02:00
Simon Giesecke 0a86aba723 Bug 1679540 - Extract CollectEachFile function and use in quota manager and clients. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D98075
2020-12-21 18:13:56 +00:00
Simon Giesecke 238ab1826e Bug 1682639 - Fix diagnostic assertion failure in PrepareDatastoreOp::DatabaseWork. r=janv,dom-workers-and-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D100002
2020-12-17 10:44:29 +00:00
Simon Giesecke 0960f946b7 Bug 1681670 - Move shutdown timeout handling to QuotaManager. r=dom-workers-and-storage-reviewers,janv
Instead of having a separate timer for each quota client, we can use a single
timer in the QuotaManager for handling timeouts of all quota clients. The
original shutdown timeout of the quota manager itself can now be removed,
as AbortOperations is already called through InitiateShutdownWorkThreads on
each quota client.

This also moves MaybeRecordShutdownStep to the QuotaManager, which allows
easier access through the singleton instance returned by QuotaManager::GetRef.

Differential Revision: https://phabricator.services.mozilla.com/D98073
2020-12-15 17:15:27 +00:00
Simon Giesecke 6e49dfa042 Bug 1678030 - Move CollectWhileHasResult to QuotaCommon and use in other quota clients. r=dom-workers-and-storage-reviewers,ttung
This patch also:

- introduces CollectElementsWhileHasResult(Typed) to collects elements in and
  array.
- uses more QM_TRYs in our code.
- changes some pieces of code to match our coding gulideline.

Also, using CollectElementsWhileHasResult and CollectWhileHasResult helps the
code in cache/DBSchema to ensure the funtion returns an error result when
ExecuteStep returns an error in the loop's condition check consistently. Before
this change, DOM cache code often doesn't check the result from ExecuteStep
after exiting the loop.

Differential Revision: https://phabricator.services.mozilla.com/D97466
2020-12-14 10:42:36 +00:00
Jan Varga 7652044f20 Bug 1680275 - LSNG: Change gPrepareDatastoreOps and gLiveDatabases to use NotNull; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D99197
2020-12-10 12:15:49 +00:00
Simon Giesecke 8d2b7cd0bf Bug 1681087 - Remove logspam from localstorage shutdown. r=janv,dom-workers-and-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D99319
2020-12-10 08:44:50 +00:00
Mihai Alexandru Michis 783558e615 Backed out changeset 547a95c0bb90 (bug 1666214) for causing talos failures.
CLOSED TREE
2020-12-09 22:08:57 +02:00
Simon Giesecke 450b013593 Bug 1666214 - Move shutdown timeout handling to QuotaManager. r=dom-workers-and-storage-reviewers,janv
Instead of having a separate timer for each quota client, we can use a single
timer in the QuotaManager for handling timeouts of all quota clients. The
original shutdown timeout of the quota manager itself can now be removed,
as AbortOperations is already called through InitiateShutdownWorkThreads on
each quota client.

This also moves MaybeRecordShutdownStep to the QuotaManager, which allows
easier access through the singleton instance returned by QuotaManager::GetRef.

Differential Revision: https://phabricator.services.mozilla.com/D98073
2020-12-09 13:03:36 +00:00
Jan Varga fe7c71a9e0 Bug 1680031 - Abort operations for given directory lock ids; r=dom-workers-and-storage-reviewers,sg
This patch changes the way how we abort operations when clearing of data is
requested. Instead of aborting all operations for given origin, we now abort
all operations for given directory locks which are blocking clearing of data.

Differential Revision: https://phabricator.services.mozilla.com/D98609
2020-12-09 08:13:44 +00:00
Simon Giesecke 0acc527c9e Bug 1678030 - Generalize CreateAndExecuteSingleStepStatement to accept an optional bind functor. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D97462
2020-12-04 15:15:31 +00:00
Simon Giesecke 1ff0e248eb Bug 1678030 - Support multiple variants of hasResult expectations in CreateAndExecuteSingleStepStatement. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D97461
2020-12-04 15:10:07 +00:00
Simon Giesecke e6b749fc81 Bug 1678030 - Move CreateAndExecuteSingleStepStatement to QuotaCommon and use in all quota clients. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D97460
2020-12-04 14:56:18 +00:00
Jan Varga e3bd5ca4f2 Bug 1680031 - LSNG: Change InvalidatePrepareDatastoreOpsMatching and InvalidatePreparedDatastoresMatching to free functions; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D98345
2020-12-03 09:22:34 +00:00
Jan Varga c0397c29f3 Bug 1680031 - LSNG: Various cleanup related to abort operations methods; r=dom-workers-and-storage-reviewers,sg
The cleanup mostly includes:
- changing the suffix of iteration methods from "If" to "Matching"
- changing the argument type of Condition from a raw pointer to a reference
- changing output parameters to return values
- changing iter-based for loops to range-based for loops
- renaming ForceKillDatabases to ForceKillAllDatabases

Differential Revision: https://phabricator.services.mozilla.com/D98346
2020-12-03 12:22:55 +00:00
Jan Varga ccea28442b Bug 1680031 - Introduce Client::AbortAllOperations; r=dom-workers-and-storage-reviewers,sg
Client::AbortOperations no longer supports the case when an empty origin string
is passed (which was used to abort all operations).

Differential Revision: https://phabricator.services.mozilla.com/D98344
2020-12-02 16:38:07 +00:00
Simon Giesecke 392d0402b0 Bug 1672369 - Record localstorage shutdown steps. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D94741
2020-11-30 13:08:59 +00:00
Simon Giesecke 257530e1da Bug 1672369 - Unify handling shutdown timeout of quota clients. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D94318
2020-11-30 10:40:59 +00:00
Simon Giesecke bafe1df218 Bug 1672369 - Pull up common ShutdownWorkThreads into QuotaClient. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D94298
2020-11-26 09:20:03 +00:00
Simon Giesecke d10d03d076 Bug 1676365 - Move SpinEventLoopUntil to separate header. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96556

Depends on D96554
2020-11-23 16:10:41 +00:00
Jan Varga a6e62c857a Bug 1619592 - Replace EnsureStorageAndOriginIsInitialized with EnsureTemporaryOriginIsInitialized in dom/localstorage; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D97260
2020-11-19 15:42:11 +00:00
Simon Giesecke d7abe77fa1 Bug 1671367 - Add overloads of NS_NewLocal*FileStream functions returning a Result and use them. r=dom-workers-and-storage-reviewers,necko-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94138
2020-11-17 19:30:05 +00:00
Simon Giesecke 936d3aba1c Bug 1671367 - Use LS_TRY in UpdateUsageFile. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94137
2020-11-17 19:30:07 +00:00
Simon Giesecke 5e18c684c2 Bug 1671367 - Change CreateStorageConnection to return a Result and use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94136
2020-11-18 09:15:41 +00:00
Simon Giesecke 22172e8e5b Bug 1671367 - Change GetUsage to return a Result and use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94135
2020-11-17 19:29:55 +00:00
Simon Giesecke e80752cbe5 Bug 1671367 - Change LoadUsageInfo to return a Result and Use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94134
2020-11-17 19:29:55 +00:00
Simon Giesecke 00efd4a24c Bug 1671367 - Change GetUsageJournalFile to return a Result and Use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94133
2020-11-17 19:29:57 +00:00
Simon Giesecke 0704913795 Bug 1671367 - Change GetUsageFile to return a Result and Use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94132
2020-11-17 19:30:00 +00:00
Simon Giesecke 4c1da92e19 Bug 1671367 - Use LS_TRY in QuotaClient::InitOrigin. r=dom-workers-and-storage-reviewers,asuth,janv
This also removes uses of REPORT_TELEMETRY_INIT_ERR, which reports to
telemetry that has already expired.

Differential Revision: https://phabricator.services.mozilla.com/D94039
2020-11-17 19:30:02 +00:00
Jan Varga a7d7c361aa Bug 1619592 - Remove unused aClientType argument in EnsureStorageAndOriginIsInitialized; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D97253
2020-11-17 08:37:00 +00:00
Bogdan Tara 0fbb64410b Backed out 8 changesets (bug 1671367) for ActorsParent.cpp related bustage CLOSED TREE
Backed out changeset cacebe0fc34c (bug 1671367)
Backed out changeset 37e2f1c36fc7 (bug 1671367)
Backed out changeset c4a3fca623aa (bug 1671367)
Backed out changeset 75e95ebade6a (bug 1671367)
Backed out changeset bfc08841dafb (bug 1671367)
Backed out changeset 445d4fd6004d (bug 1671367)
Backed out changeset 90e38a8f77d6 (bug 1671367)
Backed out changeset 7e5910c8a82e (bug 1671367)
2020-11-17 21:26:08 +02:00
Simon Giesecke 8aa789e16e Bug 1671367 - Add overloads of NS_NewLocal*FileStream functions returning a Result and use them. r=dom-workers-and-storage-reviewers,necko-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94138
2020-11-17 15:13:22 +00:00
Simon Giesecke d80bdf6884 Bug 1671367 - Use LS_TRY in UpdateUsageFile. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94137
2020-11-17 15:13:14 +00:00
Simon Giesecke ce968c0a57 Bug 1671367 - Change CreateStorageConnection to return a Result and use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94136
2020-11-17 16:13:44 +00:00
Simon Giesecke f9ec3830be Bug 1671367 - Change GetUsage to return a Result and use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94135
2020-11-17 14:43:22 +00:00
Simon Giesecke e37dcc3f16 Bug 1671367 - Change LoadUsageInfo to return a Result and Use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94134
2020-11-17 14:43:19 +00:00
Simon Giesecke db92262c7a Bug 1671367 - Change GetUsageJournalFile to return a Result and Use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94133
2020-11-17 14:43:17 +00:00
Simon Giesecke fa7912c98e Bug 1671367 - Change GetUsageFile to return a Result and Use LS_TRY. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D94132
2020-11-17 14:43:05 +00:00
Simon Giesecke 214cdb9fcf Bug 1671367 - Use LS_TRY in QuotaClient::InitOrigin. r=dom-workers-and-storage-reviewers,asuth,janv
This also removes uses of REPORT_TELEMETRY_INIT_ERR, which reports to
telemetry that has already expired.

Differential Revision: https://phabricator.services.mozilla.com/D94039
2020-11-17 14:50:45 +00:00
Simon Giesecke 3236acba9d Bug 1671369 - Change GetUsageForClient to return a UsageInfo. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D93777
2020-11-17 13:17:24 +00:00
Sylvestre Ledru fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila 964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru 5f29324f60 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Simon Giesecke f70bfd33ed Bug 1626555 - Make `dom/localstorage` buildable outside of `unified-build` environment. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D94034
2020-10-21 13:17:18 +00:00
Simon Giesecke f92973bd13 Bug 1663924 - Replace output parameters by return values on GetInfo* methods. r=dom-workers-and-storage-reviewers,ttung
This also changes all methods that use a pair of group/origin or a tuple of
suffix/group/origin input/output parameters to use a single GroupAndOrigin
resp. QuotaInfo struct input parameter or return value. Also, several types
having a pair or 3-tuple of such data members are changed to use these structs
instead.

Differential Revision: https://phabricator.services.mozilla.com/D91131
2020-10-20 11:46:31 +00:00
Simon Giesecke 8e6a721680 Bug 1663924 - Replace output parameter by return value for EnsureStorageAndOriginIsInitialized. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D92199
2020-10-14 15:46:24 +00:00
Simon Giesecke d5b79ad8da Bug 1667957 - Use new IntTo(C)String functions in dom/quota and its clients. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D91717
2020-10-14 15:45:50 +00:00
Jan Varga c865a665a1 Bug 1665019 - Add QM_ASSERT_UNREACHABLE/QM_ASSERT_UNREACHABLE_VOID as a custom return value and convert relevant code to use it; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D90520
2020-10-14 13:03:35 +00:00
Tom Tung 45a97b5b83 Bug 1654080 - Use PBackground for syncing SessionStorageCache and use LSWriteOptimizer to send data changes; r=dom-workers-and-storage-reviewers,janv,nika
This patch does:
- Use LSWriteOptimizer
- Remove SessionStorageService since it's unused.
- Move IPC from PContent to PBackground
(by SessionStorageManager{Child, Parent} and SessionStorageCache{Child, Parent}).
- Extract SessionStorageManagerBase and add PBackgroundSessionStorageManager.
- Expose a getter function to get a BackgroundParentManager for top context id
on the parent.

IPC
- Before this patch:
  - Copy from parent while loading a document.
    - Mark cache entry on the parent process as loaded by the child id.
  - Update change on checkpoint.
  - Unmark cache entry on the parent process as unloaded for the child id while
  the parent actor is destorying.
- After this patch:
  - Sync IPC load in the first SessionStorage operation.
  - Update change on checkpoint

`BackgroundSessionStorageManager`'s lifecycle on the parent process.
- Create by `SessionStorageManagerParent` and register to the `sManagers`.
- Hold by `SessionStorageManagerParent` and `sManagers`.
- Remove from the `sManagers` while the corresponding `BrowsingContext` is
destructed (on the parent process).

Depends on D89341

Differential Revision: https://phabricator.services.mozilla.com/D89342
2020-10-14 00:19:33 +00:00
Simon Giesecke 20a9b720d4 Bug 1666219 - Renamed QM_TRY_VAR etc. to QM_TRY_UNWRAP etc. r=dom-workers-and-storage-reviewers,ttung,janv
Also change some left-over QM_TRY_VAR uses with const target declarations to
QM_TRY_INSPECT et al.

Differential Revision: https://phabricator.services.mozilla.com/D90873
2020-10-02 13:23:49 +00:00
Sebastian Hengst ae5e3a0d7c Backed out 5 changesets (bug 1666219, bug 1665347) for crashing hazard task. CLOSED TREE.
Backed out changeset c261ec06a826 (bug 1665347)
Backed out changeset 212c9df41410 (bug 1665347)
Backed out changeset 435f02d9f1d7 (bug 1665347)
Backed out changeset 7b36a79247b7 (bug 1666219)
Backed out changeset af8025162523 (bug 1665347)
2020-10-01 23:17:19 +02:00
Simon Giesecke 8598a731fc Bug 1666219 - Renamed QM_TRY_VAR etc. to QM_TRY_UNWRAP etc. r=dom-workers-and-storage-reviewers,ttung,janv
Also change some left-over QM_TRY_VAR uses with const target declarations to
QM_TRY_INSPECT et al.

Differential Revision: https://phabricator.services.mozilla.com/D90873
2020-10-01 15:37:50 +00:00
Bogdan Tara 104db9798f Backed out 5 changesets (bug 1666219, bug 1665347) for indexedDB related bustage CLOSED TREE
Backed out changeset 5cd7e2d67f91 (bug 1665347)
Backed out changeset 9159fdd05097 (bug 1665347)
Backed out changeset 64a086636738 (bug 1665347)
Backed out changeset 5ef18af381ec (bug 1666219)
Backed out changeset 3b81349a5f39 (bug 1665347)
2020-10-01 17:41:23 +03:00
Simon Giesecke 4c5b983d6f Bug 1666219 - Renamed QM_TRY_VAR etc. to QM_TRY_UNWRAP etc. r=dom-workers-and-storage-reviewers,ttung,janv
Also change some left-over QM_TRY_VAR uses with const target declarations to
QM_TRY_INSPECT et al.

Differential Revision: https://phabricator.services.mozilla.com/D90873
2020-10-01 12:02:26 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Tom Tung 75112e975a Bug 1661711 - Use Result<V, E> for GetDirectoryOrigin and use *_TRY_VAR for its callsites; r=sg,dom-workers-and-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D89704
2020-09-10 12:37:37 +00:00