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 is done by generating a new ID for the actor which can be successfully
registered, then explicitly tearing the actor down, improving the consistency
of error behaviour with other error cases during actor construction.
Differential Revision: https://phabricator.services.mozilla.com/D209064
It appears that the Element member may have been creating a reference
cycle passing through the new strong WindowGlobalParent::Manager()
reference.
This patch also removes an unused member from BrowserParent which
otherwise may have needed to be cycle-collected.
Differential Revision: https://phabricator.services.mozilla.com/D207170
There are a few IPDL actors which are cycle-collected, including `PBrowser`,
`PContent`, and `PWindowGlobal`.
This patch adds support for these actors to traverse and unlink the new strong
Manager() reference added by IPDL, allowing cycles containing these actors to
be properly unlinked and avoiding leaks.
Differential Revision: https://phabricator.services.mozilla.com/D198629
This makes accessing `Manager()` on an IPDL protocol safer, and replaces the
previous ActorLifecycleProxy reference, which would only keep the manager alive
until IPDL drops its reference.
Unfortunately this introduces some leaks due to reference cycles, which will be
fixed in follow-up parts.
Differential Revision: https://phabricator.services.mozilla.com/D198624
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 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
The macro and function are meant to only be used in test circumstances, where we want the failure to
be returned. Normally in `DEBUG` builds the failure causes an immediate crash.
Differential Revision: https://phabricator.services.mozilla.com/D201158
The macro and function are meant to only be used in test circumstances, where we want the failure to
be returned. Normally in `DEBUG` builds the failure causes an immediate crash.
Differential Revision: https://phabricator.services.mozilla.com/D201158
Currently when in a DEBUG build, Shmem has a bunch of extra behaviour
and checks, which can occasionally make it more difficult to use. This
bug is to track removing some of the unnecessary checks being performed
which can make the type more complex to use safely.
Specifically, when the Shmem is destroyed at the actor level using
IPrococol::DeallocShmem or because the actor has died, in DEBUG builds
the memory mapping used by the Shmem is immediately mapped as
non-readable and non-writable. As this can happen at any time, this can
make using one of these Shmems from a different thread than the actor it
was originally bound to quite difficult. As an example, in bug 1812498,
special logic was added to VideoBridgeParent::OnChannelError to block
the actor's thread until off-thread uses of the Shmem were complete.
This behaviour was always debug-only, and is actually unnecessary. The
actual Shmem mapping is not managed by the actor, only the ability to
send it between processes, so it should be reasonable for one of these
objects to be used after the actor it was sent over is destroyed. This
patch does not change the behaviour of mapping the shared memory pages
as inaccessible for non-unsafe shmems while they are "owned" by another
process.
In the future, we may want to change the name "DeallocShmem" to be
something more representative of the true behaviour of the function
(which is to prevent further sending of the Shmem object over IPDL,
freeing IPDL's reference to the underlying shared memory segment).
Differential Revision: https://phabricator.services.mozilla.com/D197828
There are a few IPDL actors which are cycle-collected, including `PBrowser`,
`PContent`, and `PWindowGlobal`.
This patch adds support for these actors to traverse and unlink the new strong
Manager() reference added by IPDL, allowing cycles containing these actors to
be properly unlinked and avoiding leaks.
Differential Revision: https://phabricator.services.mozilla.com/D198629
This makes accessing `Manager()` on an IPDL protocol safer, and replaces the
previous ActorLifecycleProxy reference, which would only keep the manager alive
until IPDL drops its reference.
Unfortunately this introduces some leaks due to reference cycles, which will be
fixed in follow-up parts.
Differential Revision: https://phabricator.services.mozilla.com/D198624
This acts as a new class between IProtocol and IToplevelProtocol which just
introduces the AddRef and Release virtual methods. It's used to allow generic
code to hold a strong reference to an actor which is structurally known to be
reference counted, and generally will have limited use elsewhere.
Differential Revision: https://phabricator.services.mozilla.com/D198623
Use MOZ_IPC_MESSAGE_LOG to filter GOODBYE_MESSAGE_TYPE messages.
Interpret MOZ_IPC_MESSAGE_LOG elements without the "Child" or "Parent"
suffix as a request to log both sides of the given protocol.
Differential Revision: https://phabricator.services.mozilla.com/D187167
Text passed to `IPCResult::Fail` (and, therefore, text passed to
`IPC_FAIL`) may end up in telemetry.
To avoid accidentally capturing unwanted information, restrict all such
text to compile-time constant strings, unless approved by data-review.
Differential Revision: https://phabricator.services.mozilla.com/D180152
This should avoid potential fuzzing-only issues which would be caused by
the actor being torn down synchronously after a FatalError or KillHard.
Instead, the state is set to error synchronously, blocking all further
message sending/receiving, and the notification is made async, similar
to how it is handled for normal channel errors.
Differential Revision: https://phabricator.services.mozilla.com/D180254
This patch changes KillHard() such that the IPC channel is immediately
shut down with an error after a KillHard() is performed. This is done by
fixing the previously-broken CLOSE_CHANNEL_WITH_ERROR support in
ShutDownProcess, and calling that method after KillHard().
This ensures that after the process has been killed, no further messages
will be delivered and processed, even if they were sent before the
process was killed.
In addition, the assertions and KillHard calls which are disabled for
fuzzing were changed to also shut down the channel, making fuzzing IPC
errors cause the connection to be terminated like it is in production
for these actors.
This change does not impact actors which ignore processing errors.
Differential Revision: https://phabricator.services.mozilla.com/D178383
This actually hasn't ever been used in a shipping build of Firefox.
Although sync IPDL was tried with Windos a11y for a while when e10s was still disabled, it was never feasible and was replaced with COM proxying.
Differential Revision: https://phabricator.services.mozilla.com/D177965
This actually hasn't ever been used in a shipping build of Firefox.
Although sync IPDL was tried with Windos a11y for a while when e10s was still disabled, it was never feasible and was replaced with COM proxying.
Differential Revision: https://phabricator.services.mozilla.com/D177965
This patch changes KillHard() such that the IPC channel is immediately
shut down with an error after a KillHard() is performed. This is done by
fixing the previously-broken CLOSE_CHANNEL_WITH_ERROR support in
ShutDownProcess, and calling that method after KillHard().
This ensures that after the process has been killed, no further messages
will be delivered and processed, even if they were sent before the
process was killed.
In addition, the assertions and KillHard calls which are disabled for
fuzzing were changed to also shut down the channel, making fuzzing IPC
errors cause the connection to be terminated like it is in production
for these actors.
This change does not impact actors which ignore processing errors.
Differential Revision: https://phabricator.services.mozilla.com/D178383
This won't be used for any security or routing purposes, but can be useful for
debugging. It will be used in the future by the profiler to correlate sent and
received message events across processes.
Differential Revision: https://phabricator.services.mozilla.com/D153621
This type is also used in other places to start non-initial actors, and will
allow us to attach additional state more easily without needing to thread it
through every child process callsite manually.
Differential Revision: https://phabricator.services.mozilla.com/D153618
This makes passing around the type more consistent, and hopefully will make
changes to IPC::Message easier to work with in the future.
In addition, this should save us a few copies as we move the message type into
and out of UniquePtr, however I expect this won't make much of a difference.
Differential Revision: https://phabricator.services.mozilla.com/D145885
This makes passing around the type more consistent, and hopefully will make
changes to IPC::Message easier to work with in the future.
In addition, this should save us a few copies as we move the message type into
and out of UniquePtr, however I expect this won't make much of a difference.
Differential Revision: https://phabricator.services.mozilla.com/D145885