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
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
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
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
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
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
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
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
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