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

159 Коммитов

Автор SHA1 Сообщение Дата
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 09996cc685 Bug 1709067 - CACHE: Remove module specific QM_TRY macros; r=dom-storage-reviewers,jstutte
Depends on D114080

Differential Revision: https://phabricator.services.mozilla.com/D114081
2021-05-03 19:44:39 +00:00
Jan Varga 7d3ef83b0f 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 12:27:53 +00:00
Butkovits Atila 9fc0210ad3 Backed out changeset 2a3316bd2409 (bug 1686191) for causing bustages on QuotaCommon.h. CLOSED TREE 2021-03-24 07:12:55 +02:00
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
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
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
Simon Giesecke b011d2e6fb Bug 1683828 - Use QM_TRY et al. in QuotaClient. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100770
2021-01-18 08:52:06 +00:00
Simon Giesecke 4d71349bf7 Bug 1683828 - Use QM_TRY et al. in Manager. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100769
2021-01-18 08:49:48 +00:00
Simon Giesecke c0b5a7fcba Bug 1683828 - Use QM_TRY et al. in Manager and modernize signatures. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100665
2021-01-14 16:09:32 +00:00
Simon Giesecke 731e2bb3f2 Bug 1683828 - Use QM_TRY et al. in FileUtils and modernize signatures. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100320
2021-01-14 16:42:32 +00:00
Simon Giesecke 641ad4b8f6 Bug 1682536 - Use references/NotNull in Manager. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D99776
2020-12-17 16:14:43 +00:00
Simon Giesecke b9386ba506 Bug 1682542 - Make use of standard algorithms in dom/cache. r=dom-workers-and-storage-reviewers,asuth
Specifically, instead of using custom loops
- use std::find_if in CacheOpParent::ProcessCrossOriginResourcePolicyHeader
- use ReduceEach in SetupAction::RunSyncWithDBOnTarget
- use std::any_of in Manager::RemoveContext
- use std::find_if in Manager::(Add|Release)Ref(Cache|Body)Id and
  Manager::Set(Cache|Body)IdOrphanedIfRefed
- use std::copy_if in Manager::NoteOrphanedBodyIdList
- use std::any_of in StreamList::ShouldOpenStreamFor
- use std::find_if in StreamList::Extract, StreamList::NoteClosed
- use std::exchange in StreamList::CloseAll
- use std::transform in ToHeadersEntryList and change it to return a value
  rather than modifying an output parameter
- use std::transform in TypeUtils::ToInternalHeaders

Differential Revision: https://phabricator.services.mozilla.com/D99789
2020-12-16 19:10:57 +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
Jan Varga 88e9e3cb95 Bug 1680275 - DOMCACHE: Change Manager::Factory::mManagerList to use NotNull; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D98718
2020-12-10 12:13:46 +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 b2d834a030 Bug 1680724 - Use ToMaybeRef or SafeRefPtr::maybeDeref where possible. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D98784
2020-12-08 17:49:30 +00:00
Jan Varga 6aee31c945 Bug 1680031 - DOMCACHE: Change argument type of Condition in AbortMatching to a reference; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D98430
2020-12-02 16:48:45 +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 6f59efdcd5 Bug 1672369 - Record Cache API shutdown steps. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D94740
2020-11-30 13:04:23 +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
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
Jan Varga 976d8082ca Bug 1671118 - Rename remaining QM_TRY_VAR occurrences to QM_TRY_ASSIGN/QM_TRY_UNWRAP/QM_TRY_INSPECT (including quota client equivalents); r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D93477
2020-10-14 12:14:14 +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
Tom Tung 4e7b64f602 Bug 1655067 - Use Result<V, E> for some functions and use CACHE_TRY_VAR for their callsites; r=dom-workers-and-storage-reviewers,sg
Depends on D86209

Differential Revision: https://phabricator.services.mozilla.com/D84837
2020-09-11 07:58:34 +00:00
Tom Tung c142edf3a3 Bug 1655067 - Replace raw pointer input parameters by reference; r=dom-workers-and-storage-reviewers,sg
Depends on D85972

Differential Revision: https://phabricator.services.mozilla.com/D84836
2020-09-11 08:13:04 +00:00
Tom Tung b6322a2f7b Bug 1651593 - Check the return value of db::GetKnownBodyIds(); r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D82863
2020-07-09 07:27:46 +00:00
ssengupta 2383ba6a82 Bug 1636050 - dom::cache::Action now inherits from SafeRefCounted r=dom-workers-and-storage-reviewers,sg
Depends on D80669

Differential Revision: https://phabricator.services.mozilla.com/D80709
2020-07-01 14:20:12 +00:00
ssengupta 9c107d41f5 Bug 1636050 - dom::cache::Action::Resolver now inherits from SafeRefCounted r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D80669
2020-07-01 14:20:08 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Jean-Yves Avenard 87438519f0 Bug 1637500 - P2. Rename methods as they are not always dealing with "threads". r=froydnj
Before P1, GetCurrentThreadSerialEventTarget would have always returned the same data as NS_GetCurrentThread, making the comment incorrect Now it will properly return the running TaskQueue if any.

This change of name more clearly exposes what they are doing, as we aren't always dealing with threads directly; but a nsISerialEventTarget

Differential Revision: https://phabricator.services.mozilla.com/D80354
2020-06-23 05:05:36 +00:00
Simon Giesecke 8d168248fa Bug 1645386 - Use nsTObserverArray::NonObservingRange where possible instead of ForwardRange. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79507
2020-06-22 08:21:24 +00:00
Simon Giesecke bfb7f6a78a Bug 1645339 - Use range-based for with nsTObserverArray in dom/cache. r=dom-workers-and-storage-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D79431
2020-06-17 15:04:24 +00:00
Jean-Yves Avenard 2fade796dc Bug 1644009 - P2. Revert "Bug 1592488 - P9. Make a DOMCacheThread an AbstractThread." r=nika
DirectTask dispatching will now be directly handled by nsThread.

Differential Revision: https://phabricator.services.mozilla.com/D79086
2020-06-12 05:09:33 +00:00
Jean-Yves Avenard dde81db3d7 Bug 1592488 - P9. Make a DOMCacheThread an AbstractThread. r=baku
This is a step towards bug 1119864. However, at this stage we only need the cache thread to support direct task dispatch so that we can have IPDL MozPromise acting in a similar fashion to JS promise.

Differential Revision: https://phabricator.services.mozilla.com/D74637
2020-05-13 00:12:19 +00:00
Simon Giesecke 4bd2bbd28a Bug 1627892 - Make ManagerId derive from SafeRefCounted. r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D69961
2020-05-11 12:13:07 +00:00
Simon Giesecke 8118041984 Bug 1627892 - Make StreamList derive from SafeRefCounted. r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D69959
2020-05-11 12:11:33 +00:00
Simon Giesecke c4c6f0c42c Bug 1627892 - Make Context derive from SafeRefCounted. r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D69957
2020-05-11 12:09:55 +00:00
Simon Giesecke 33a08c2818 Bug 1627892 - Make Manager derive from SafeRefCounted. r=ttung
Differential Revision: https://phabricator.services.mozilla.com/D69956
2020-05-11 12:09:02 +00:00
Simon Giesecke daf66e3fc8 Bug 1626570 - Improve handling of copying arrays in dom/cache/. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D73643
2020-05-07 08:49:15 +00:00
Tom Tung 09903525ea Bug 1628076 - Ensure sFactory alive while it is calling Abort; r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D71323
2020-04-21 19:57:46 +00:00