941 Commits

Author SHA1 Message Date
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
d3b3ad3a3d Bug 1690234 - Ignore ERROR_FILE_CORRUPT when calling BodyTraverseFiles from within CollectEachFile/ReduceUsageInfo. r=dom-workers-and-storage-reviewers,janv,asuth
Differential Revision: https://phabricator.services.mozilla.com/D103785
2021-02-12 09:14:21 +00:00
Nika Layzell
63fd915bfb Bug 1689147 - Part 1: Add extended attribute syntax to IPDL, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D103366
2021-02-09 16:50:21 +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
smolnar
fa581f2aee Bug 1687321 - Fix lint failure in dom/cache/FileUtils.cpp a=lint-fix CLOSED TREE 2021-02-08 15:52:49 +02:00
Simon Giesecke
26725b587f Bug 1687321 - Use GetDirEntryKind instead of IsDirectory when iterating over directory entries in dom/cache. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D103763
2021-02-08 13:15:50 +00:00
Nika Layzell
6720e65c4e Bug 1681529 - Part 11: Avoid using DelayedStart when serialzing the reply from SendOpenStream, r=asuth
Streams serialized with the default nsIInputStream serializer will be serialized
with delayedStart, meaning that when sent from the parent process to the content
process it will be serialized as a RemoteLazyInputStream.

In the specific case of SendOpenStream this causes issues, as the content
process code depends on the synchronous nature of nsIFileInputStream to allow it
to be wrapped in a SnappyUncompressInputStream, which requires a sync stream.

Relying on this property is not generally correct and only works because we know
only nsFileInputStream will be sent by the parent process. Other types of sync
streams may be received as async if they are sufficiently large, such as
nsStringInputStream.

Differential Revision: https://phabricator.services.mozilla.com/D103227
2021-02-04 18:13:22 +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
Bogdan Tara
abc7c8eeee Backed out 11 changesets (bug 1681529) for talos crashes CLOSED TREE
Backed out changeset c87d0f32d7a6 (bug 1681529)
Backed out changeset b1269f35d525 (bug 1681529)
Backed out changeset 29df8d4c984a (bug 1681529)
Backed out changeset 4def7578ced0 (bug 1681529)
Backed out changeset ce57c5a26c25 (bug 1681529)
Backed out changeset 78b186ec645a (bug 1681529)
Backed out changeset b1d1550a66ca (bug 1681529)
Backed out changeset e8620622208a (bug 1681529)
Backed out changeset 636b1a7c13e4 (bug 1681529)
Backed out changeset a5a8eac68b87 (bug 1681529)
Backed out changeset 968e17db71df (bug 1681529)
2021-02-03 09:29:38 +02:00
Nika Layzell
b245b926b3 Bug 1681529 - Part 11: Avoid using DelayedStart when serialzing the reply from SendOpenStream, r=asuth
Streams serialized with the default nsIInputStream serializer will be serialized
with delayedStart, meaning that when sent from the parent process to the content
process it will be serialized as a RemoteLazyInputStream.

In the specific case of SendOpenStream this causes issues, as the content
process code depends on the synchronous nature of nsIFileInputStream to allow it
to be wrapped in a SnappyUncompressInputStream, which requires a sync stream.

Relying on this property is not generally correct and only works because we know
only nsFileInputStream will be sent by the parent process. Other types of sync
streams may be received as async if they are sufficiently large, such as
nsStringInputStream.

Differential Revision: https://phabricator.services.mozilla.com/D103227
2021-02-02 23:26:46 +00:00
Brindusan Cristian
cbdb020883 Backed out 11 changesets (bug 1681529) for mochitest failures at test_reload_large_postdata.html. CLOSED TREE
Backed out changeset f1f988155c82 (bug 1681529)
Backed out changeset f0ba367de05e (bug 1681529)
Backed out changeset dbea9952ec79 (bug 1681529)
Backed out changeset 6e185ec2c4a4 (bug 1681529)
Backed out changeset d0b11c08666a (bug 1681529)
Backed out changeset f2515096b378 (bug 1681529)
Backed out changeset ecd8c3b8fdb4 (bug 1681529)
Backed out changeset 7ea2e9cc8bad (bug 1681529)
Backed out changeset dbc85d0bffaf (bug 1681529)
Backed out changeset f0893f544219 (bug 1681529)
Backed out changeset 91979e21aa8e (bug 1681529)
2021-02-02 22:02:59 +02:00
Nika Layzell
681cd1b0fe Bug 1681529 - Part 11: Avoid using DelayedStart when serialzing the reply from SendOpenStream, r=asuth
Streams serialized with the default nsIInputStream serializer will be serialized
with delayedStart, meaning that when sent from the parent process to the content
process it will be serialized as a RemoteLazyInputStream.

In the specific case of SendOpenStream this causes issues, as the content
process code depends on the synchronous nature of nsIFileInputStream to allow it
to be wrapped in a SnappyUncompressInputStream, which requires a sync stream.

Relying on this property is not generally correct and only works because we know
only nsFileInputStream will be sent by the parent process. Other types of sync
streams may be received as async if they are sufficiently large, such as
nsStringInputStream.

Differential Revision: https://phabricator.services.mozilla.com/D103227
2021-02-02 19:19:28 +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
Simon Giesecke
09a0eebdd9 Bug 1686749 - Let CreateFile*Stream functions propagate all errors. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D101779
2021-01-28 11:12:19 +00:00
Simon Giesecke
4e33445ac3 Bug 1687254 - Skip directory entries that no longer exist in GetBodyUsage. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D102204
2021-01-21 15:33:04 +00:00
Simon Giesecke
294006b424 Bug 1682536 - Use references/NotNull with Listener. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D99786
2021-01-21 11:58:37 +00:00
Simon Giesecke
3d71cff61d Bug 1683828 - Use QM_TRY et al. in DBSchema. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100771
2021-01-20 16:35:48 +00:00
Luca Greco
3ba66d4d86 Bug 1678927 - Expect non http channel in ServiceWorkerScriptCache CompareNetwork::OnStreamComplete. r=asuth,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D100343
2021-01-19 15:27:46 +00:00
Masatoshi Kimura
54c1b8dee1 Bug 1687108 - Remove unused content policy types. r=ckerschb,remote-protocol-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D102083
2021-01-19 09:42:13 +00:00
Simon Giesecke
b072bdbb20 Bug 1684838 - Check result of CreateAndExecuteSingleStepStatement in ReadRequest. r=jstutte
Differential Revision: https://phabricator.services.mozilla.com/D102185
2021-01-18 12:57:26 +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
31ff3b6a71 Bug 1683828 - Use QM_TRY et al. in CacheStorage. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100768
2021-01-14 16:30:12 +00:00
Simon Giesecke
48bc696200 Bug 1683828 - Use QM_TRY et al. in Cache. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100767
2021-01-14 15:51:47 +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
2951ef3a35 Bug 1683828 - Use QM_TRY et al. in DBAction and modernize signatures. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100321
2021-01-14 16:42: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
37d1a8c6b9 Bug 1683828 - Use QM_TRY et al in QueryCache. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100319
2021-01-11 13:35:54 +00:00
Simon Giesecke
37567c5f85 Bug 1685298 - Fix uninitialized variable in non-diagnostic builds. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D100925
2021-01-11 09:20:25 +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
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
4756746f18 Bug 1682536 - Use references/NotNull in Context. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D99775
2020-12-15 23:25:30 +00:00
Simon Giesecke
88142da40d Bug 1682536 - Use references/NotNull in CacheWorkerRef. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D99774
2020-12-17 16:14:52 +00:00
Masatoshi Kimura
3424a95ee0 Bug 1682103 - Make nsContentPolicyType a CEnum type. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D99580
2020-12-16 11:36:47 +00:00
Simon Giesecke
db8cc251fb Bug 1679987 - Replace strtok for Vary header by nsCCharSeparatedTokenizer and range-based for. r=necko-reviewers,dom-workers-and-storage-reviewers,asuth,valentin
Differential Revision: https://phabricator.services.mozilla.com/D98309
2020-12-16 19:10:41 +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
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
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
Simon Giesecke
4cab6ac723 Bug 1677466 - Move ParamTraits specializations with extra dependencies out of IPCMessageUtils.h. r=mccr8
This moves parts of IPCMessageUtils.h to two new header files and adapts
the include directives as necessary. The new header files are:
- EnumSerializer.h, which defines the templates for enum serializers
- IPCMessageUtilsSpecializations.h, which defines template specializations
  of ParamTraits with extra dependencies (building upon both IPCMessageUtils.h
  and EnumSerializer.h)

This should minimize the dependencies pulled in by every consumer of
IPCMessageUtils.h

Differential Revision: https://phabricator.services.mozilla.com/D94459
2020-12-10 11:09:21 +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
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