Previously the handling for the IO thread was split between
BrowserProcessSubThread (a replication of the background thread infrastructure
used by Chromium during the IPC import, which is only used for the IO thread in
Gecko), and IOThreadChild (a wrapper around ChildThread, which was imported
from Chromium's source).
This meant that there was little code-sharing between the parent and child
processes, and that the lifecycle of the IO thread was perhaps less clear.
This refactors the code to centralize handling of these threads, and provide a
basic common interface. At the moment, actually hooking up async IO listeners
is still done using the Chromium interfaces.
Differential Revision: https://phabricator.services.mozilla.com/D227739
Previously the handling for the IO thread was split between
BrowserProcessSubThread (a replication of the background thread infrastructure
used by Chromium during the IPC import, which is only used for the IO thread in
Gecko), and IOThreadChild (a wrapper around ChildThread, which was imported
from Chromium's source).
This meant that there was little code-sharing between the parent and child
processes, and that the lifecycle of the IO thread was perhaps less clear.
This refactors the code to centralize handling of these threads, and provide a
basic common interface. At the moment, actually hooking up async IO listeners
is still done using the Chromium interfaces.
Differential Revision: https://phabricator.services.mozilla.com/D227739
There was an installer size regression for macOS after the previous
change. I vaguely expect that this was in part caused by moving blocks
of duplicate IPDL serialization/deserialization logic into callback
lambdas, rather than in the larger OnMessageReceived handler function,
potentially leading to less code deduplication.
This patch moves the common parts of the IPDL message deserialization,
for the parts of the message which were serialized by IPDLResolverInner,
into the IPDLAsyncReturnsCallback class.
As a side-effect of this change, things like IPDL message ID validation
and reject case handling has also been moved to generic rather than
generated code.
Differential Revision: https://phabricator.services.mozilla.com/D228099
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.
Differential Revision: https://phabricator.services.mozilla.com/D223341
Add an entry point to ClipboardContentAnalysisParent to get all the
data on the clipboard, which also analyzes all the clipboard contents.
Differential Revision: https://phabricator.services.mozilla.com/D223412
Add an entry point to ClipboardContentAnalysisParent to get all the
data on the clipboard, which also analyzes all the clipboard contents.
Differential Revision: https://phabricator.services.mozilla.com/D223412
This patch makes it so that we pass along the necessary buffers as we go
along with encoding/decoding. This should increase shmem reuse, avoid
sync IPDL calls and reduce the overall complexity for buffer management.
Differential Revision: https://phabricator.services.mozilla.com/D226272
This reduces the amount of casting required during async replies checks,
and ensures that the lifetimes of async replies callbacks are directly
tied to IPDL actor lifetimes.
This change does lose the unresolved-ipc-responses nsIMemoryReporter
implementation, as they are no longer stored as centrally.
Differential Revision: https://phabricator.services.mozilla.com/D226061
The initial IPC pipe was previously the only argument passed as a chromium
command line flag. This changes it to instead be passed using geckoargs,
unifying the platforms, and removing the need for specific handling on every
platform.
Differential Revision: https://phabricator.services.mozilla.com/D221374
This patch implements the majority of the public interface for the new IPC
handle passing design.
The rough design is an expansion of `geckoargs` to allow passing
`UniqueFileHandle` arguments to child processes. This replaces the existing
extra options array to make the list of files explicit.
This currently just replaces things which were already passed this way on the
command line from outside of GeckoChildProcessHost. Note that this does not
migrate callers which were not already passing file handles using geckoargs,
and does not implement the actual OS-level support for passing arguments this
way.
Differential Revision: https://phabricator.services.mozilla.com/D221371
The initial IPC pipe was previously the only argument passed as a chromium
command line flag. This changes it to instead be passed using geckoargs,
unifying the platforms, and removing the need for specific handling on every
platform.
Differential Revision: https://phabricator.services.mozilla.com/D221374
This patch implements the majority of the public interface for the new IPC
handle passing design.
The rough design is an expansion of `geckoargs` to allow passing
`UniqueFileHandle` arguments to child processes. This replaces the existing
extra options array to make the list of files explicit.
This currently just replaces things which were already passed this way on the
command line from outside of GeckoChildProcessHost. Note that this does not
migrate callers which were not already passing file handles using geckoargs,
and does not implement the actual OS-level support for passing arguments this
way.
Differential Revision: https://phabricator.services.mozilla.com/D221371
This requires quite a bit of piping to get the ChildID passed everywhere where
we currently pass the pid in IPC. This is done by adding a new struct type
(EndpointProcInfo), which is passed around instead of OtherPid in these places,
and contains the full pid.
In most cases, it was a fairly painless change to move over, however in some
cases, more complex changes were required, as the pid was being stored
previously in something like an Atomic<...>, and needed to be switched to using
a mutex-protected value.
In the future, it may be possible to remove OtherPid from IPDL actors once
everything is migrated to ChildID, but we're still a long way off from that, so
for now we unfortunately need to pass both around.
Differential Revision: https://phabricator.services.mozilla.com/D217118
In more recent versions of C++, it is possible to declare a C union with
non-POD members, so long as there is an explicit destructor/constructor
responsible for managing the members.
This patch switches to using the variant types directly within the
union, rather than using AlignedStorage to store inline members. This
requires some tweaks to how the union is declared (specifically, it must
be an anonymous inline union so that it shares the main union type's
constructor/destructor, otherwise explicit ctors/dtors would need to be
declared for the bare union type).
Overall, this change should make no functional difference.
Differential Revision: https://phabricator.services.mozilla.com/D216329
This patch adjusts ManagedContainer to have a common base class, and exposes
methods for interacting with this base class from generic code on IProtocol.
This avoids the need for some specialized methods which were previously
required in order to manipulate the managed lists which allows the ordering to
be more precisely controlled in generic actor lifecycle methods.
Differential Revision: https://phabricator.services.mozilla.com/D209855
This changes the way that StmtCode handles the pattern `$,{list}` alone on a
line, adjusting it such that each item on the list is printed onto its own
line, and then indented. This helps the formatting of large lists such as the
ones generated in part 2.
Differential Revision: https://phabricator.services.mozilla.com/D209854
Slightly restructure the script to be compatible with multiprocessing,
but in a non-intrusive way: guard execution by __main__ and use shared
containers for shared states.
Avoid a redundant parser call (even if cached).
Differential Revision: https://phabricator.services.mozilla.com/D207180
With the new changes in bug 1724083, it is possible for an actor to be
destroyed during SetManagerAndRegister, which can lead to RemoveManagee being
called before the managee is even registered, leading to an assertion failure.
The easiest fix here is to relax this assertion, as we won't insert the entry
later in this failure case.
Differential Revision: https://phabricator.services.mozilla.com/D208936
If the path to your source checkout on Windows is sufficiently long enough, you
can hit the Windows maximum commandline argument limit (32k) specifying IPDL
files to ipdl.py during build. Writing the list of files to a file and passing
that to ipdl.py gets around this error completely.
Differential Revision: https://phabricator.services.mozilla.com/D204949
This removes intr support and updates some stale docs as well.
It's not immediately clear what code in MessageChannel can be removed,
though I expect some things could be simplified (there's just not much
alluding to intr/rpc/urgent).
Differential Revision: https://phabricator.services.mozilla.com/D204813
If the path to your source checkout on Windows is sufficiently long enough, you
can hit the Windows maximum commandline argument limit (32k) specifying IPDL
files to ipdl.py during build. Writing the list of files to a file and passing
that to ipdl.py gets around this error completely.
Differential Revision: https://phabricator.services.mozilla.com/D204949
This removes intr support and updates some stale docs as well.
It's not immediately clear what code in MessageChannel can be removed,
though I expect some things could be simplified (there's just not much
alluding to intr/rpc/urgent).
Differential Revision: https://phabricator.services.mozilla.com/D204813
This is a sync version of `nsIClipboard.asyncGetData`, which can be used for
synchronous clipboard APIs, e.g. DataTransfer, to support the clipboard seqence
number concept, see bug 1879401.
Differential Revision: https://phabricator.services.mozilla.com/D201364