Commit graph

194 commits

Author SHA1 Message Date
Jens Stutte
55f62b6c21 Bug 1727526 - Abort DBAction::RunOnTarget if AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM) r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D204587
2024-03-18 14:27:34 +00:00
Jens Stutte
6dfca922cc Bug 1727526 - Have a Stringifyable base class. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D191082
2023-12-11 15:17:12 +00:00
Jan Varga
565db2a48e Bug 1866240 - Maintain usage information in the database; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D195081
2023-12-01 22:38:10 +00:00
Cristian Tuns
ed8df998c6 Backed out changeset 0279020821f5 (bug 1866240) for causing mochitest failures in test_cache_padding.html CLOSED TREE 2023-12-01 13:06:52 -05:00
Jan Varga
caae08ea04 Bug 1866240 - Maintain usage information in the database; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D195081
2023-12-01 16:57:13 +00:00
hsingh
a68c2ad072 Bug 1835298: Encrypt CacheAPI data on disk in PBM.r=dom-storage-reviewers,janv
Depends on D180296

Differential Revision: https://phabricator.services.mozilla.com/D180297
2023-10-27 14:10:08 +00:00
Jens Stutte
7e53e6925d Bug 1727526 - Add more information to cache manager shutdown hang annotations. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D190795
2023-10-13 12:16:26 +00:00
Nika Layzell
78fa962afb Bug 1814683 - Part 1: Combine parent/child fields in IPDL structs/unions, r=ipc-reviewers,necko-reviewers,mccr8
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.

This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.

Differential Revision: https://phabricator.services.mozilla.com/D168879
2023-03-20 15:40:31 +00:00
Iulian Moraru
801dae8f2c Backed out 14 changesets (bug 1607634, bug 1814683, bug 1815177, bug 1814686) for causing build bustages on MaybeStorageBase. CLOSED TREE
Backed out changeset ae1c0551cea5 (bug 1815177)
Backed out changeset a11cafaa1884 (bug 1814686)
Backed out changeset 621507521762 (bug 1814686)
Backed out changeset ad692c73e381 (bug 1814686)
Backed out changeset 3be031e503dc (bug 1607634)
Backed out changeset aebbaa145d2d (bug 1607634)
Backed out changeset 9aa1f346fe14 (bug 1607634)
Backed out changeset e3eb77ad55ca (bug 1607634)
Backed out changeset e60591e5d5cf (bug 1607634)
Backed out changeset 6e43042d204a (bug 1814683)
Backed out changeset 1706e88652d6 (bug 1814683)
Backed out changeset 6878a1590e91 (bug 1814683)
Backed out changeset b1c980c834d8 (bug 1814683)
Backed out changeset 94480b82d102 (bug 1814683)
2023-03-15 01:58:36 +02:00
Nika Layzell
97577629c0 Bug 1814683 - Part 1: Combine parent/child fields in IPDL structs/unions, r=ipc-reviewers,necko-reviewers,mccr8
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.

This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.

Differential Revision: https://phabricator.services.mozilla.com/D168879
2023-03-14 19:31:36 +00:00
Nika Layzell
59be033e1c Bug 1809753 - Part 1: Remove quantum-dom nsIThread::EventTarget methods, r=mccr8
We aren't likely to try to make these changes any time soon, so cleaning out
these unnecessary methods which just return `this` will simplify things.

I was unable to find any calls to the `.eventTarget` getter in JS, which makes
sense, as the nsIThread type is only really used in JS as a wrapper around the
main thread in older code. Because of that, it has been removed as well.

Differential Revision: https://phabricator.services.mozilla.com/D166605
2023-01-16 23:14:10 +00:00
Sandor Molnar
41b78439d0 Backed out 6 changesets (bug 1809752, bug 1809753) for causing perma failures in browser/components/firefoxview/tests/browser/browser_feature_callout_position.js
Backed out changeset ea05784d74c4 (bug 1809753)
Backed out changeset 7c9b20eebcc8 (bug 1809753)
Backed out changeset d0267ac2256d (bug 1809753)
Backed out changeset aa9f2971bd6f (bug 1809753)
Backed out changeset f0d9fcfaa6f8 (bug 1809752)
Backed out changeset 6d58c799cffe (bug 1809752)
2023-01-17 03:19:24 +02:00
Nika Layzell
f410f28a30 Bug 1809753 - Part 1: Remove quantum-dom nsIThread::EventTarget methods, r=mccr8
We aren't likely to try to make these changes any time soon, so cleaning out
these unnecessary methods which just return `this` will simplify things.

I was unable to find any calls to the `.eventTarget` getter in JS, which makes
sense, as the nsIThread type is only really used in JS as a wrapper around the
main thread in older code. Because of that, it has been removed as well.

Differential Revision: https://phabricator.services.mozilla.com/D166605
2023-01-16 23:14:10 +00:00
Jens Stutte
9db2246cff Bug 1757144: Abort DOMCACHE operations on InitiateShutdown. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D139690
2022-03-17 10:01:09 +00:00
Randell Jesup
fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila
927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Jens Stutte
70eb823048 Bug 1727526: Make AssertWillDelete check mStreamList and remove suspect candidates on ActorDestroy. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D139569
2022-02-24 10:25:09 +00:00
Jens Stutte
69241c3e22 Bug 1727526: Add AssertWillDelete before calling Send__delete__ on CacheStreamControlParent. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D139379
2022-02-22 17:13:10 +00:00
Haiyang Xu
aafd5d8064 Bug 1672140 - Rename cache::ClientMetadata to cache::CacheDirectoryMetadata; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D131590
2021-11-24 20:50:37 +00:00
hxu
93316dde65 Bug 1672140 - Change cache::ClientMetadata's base class from quota::OriginMetadata to quota::ClientMetadata; r=dom-storage-reviewers,janv
Depends on D125583

Differential Revision: https://phabricator.services.mozilla.com/D126056
2021-11-24 20:50:37 +00:00
hxu
2dbd17aeac Bug 1672140 - Rename cache::QuotaInfo to cache::ClientMetadata and rename corresponding functions; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D125583
2021-11-24 20:50:36 +00:00
Butkovits Atila
af69ca9209 Backed out 3 changesets (bug 1672140) for causing Bp-hybrid build bustages.
Backed out changeset 32edbc243607 (bug 1672140)
Backed out changeset 549556f430a7 (bug 1672140)
Backed out changeset 396640d13ece (bug 1672140)
2021-11-23 20:25:56 +02:00
Haiyang Xu
cd667b26f8 Bug 1672140 - Rename cache::ClientMetadata to cache::CacheDirectoryMetadata; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D131590
2021-11-23 16:53:50 +00:00
hxu
95d8bdaa44 Bug 1672140 - Change cache::ClientMetadata's base class from quota::OriginMetadata to quota::ClientMetadata; r=dom-storage-reviewers,janv
Depends on D125583

Differential Revision: https://phabricator.services.mozilla.com/D126056
2021-11-23 16:53:50 +00:00
hxu
45a53e311d Bug 1672140 - Rename cache::QuotaInfo to cache::ClientMetadata and rename corresponding functions; r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D125583
2021-11-23 16:53:49 +00:00
Jan Varga
572fb1f823 Bug 1731544 - Replace existing ToResult uses with MOZ_TO_RESULT; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D125324
2021-10-10 19:06:36 +00:00
Jan Varga
685aa0cc5e Bug 1728267 - Remove implicit ToResult from QM_TRY when no extra argument is passed in dom/cache; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125319
2021-09-24 13:08:30 +00:00
Jan Varga
b4ef3d074a Bug 1728267 - Remove implicit ToResult from QM_TRY when one extra argument is passed; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125316
2021-09-23 10:16:09 +00:00
Jan Varga
4cc9bf1d18 Bug 1728267 - Remove implicit ToResult from QM_TRY when two extra arguments are passed; r=dom-storage-reviewers,jstutte,jari
Differential Revision: https://phabricator.services.mozilla.com/D125315
2021-09-23 10:16:09 +00:00
Jan Varga
eccdb851bb Bug 1728267 - Remove implicit ToResult from QM_WARNONLY_TRY macros; r=dom-storage-reviewers,jstutte,jari
We can use QM_TO_RESULT (instead of MOZ_TO_RESULT) because QM_WARNONLY_TRY
doesn't propagate errors, so no other adjustment is needed.

Differential Revision: https://phabricator.services.mozilla.com/D125314
2021-09-23 10:16:08 +00:00
hxu
ba25f249eb Bug 1726598 - Remove sFactoryShutdown and sMutex from dom::cache::Manager since they are obselete. r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D125678
2021-09-23 09:04:41 +00:00
Jens Stutte
e55b9dfeb0 Bug 1588498: Forbid the creation of new cache Context objects during quota manager shutdown. r=dom-storage-reviewers,asuth
We want to enforce the (assumed) invariant that after we started QM shutdown we should not create new contextes and associated threads for cache IO. We do this generating a runtime error, whose handling might not be consistent in all (unexpected) cases, yet. But this is preferable over a shutdown hang crash, for sure.

Differential Revision: https://phabricator.services.mozilla.com/D123137
2021-08-20 05:49:26 +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
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