Commit Graph

8156 Commits

Author SHA1 Message Date
Nika Layzell
d1d7554feb Bug 1893087 - Part 2: Add test for constructing an actor under an already dead manager, r=ipc-reviewers,mccr8
Depends on D208936

Differential Revision: https://phabricator.services.mozilla.com/D209053
2024-04-30 21:27:34 +00:00
Nika Layzell
039cb74465 Bug 1893087 - Part 1: Relax assertion in RemoveManagee, r=ipc-reviewers,mccr8
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
2024-04-30 21:27:33 +00:00
Nika Layzell
3aed03b1c5 Bug 1724083 - Part 3: Add a test to ensure IPDL actors handle reentrant destruction, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D206797
2024-04-22 17:31:06 +00:00
Nika Layzell
9ee77f6ae1 Bug 1724083 - Part 1: Rework ActorDestroy logic to be more resilient to nested event loops, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D198840
2024-04-22 17:31:06 +00:00
Nika Layzell
c968f54ada Bug 1875528 - Part 7: Expose more BrowserParent members to the CC, r=smaug
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
2024-04-22 17:13:25 +00:00
Nika Layzell
33e1dcc9e0 Bug 1875528 - Part 6: Allow cycle-collecting the strong IPDL Manager reference, r=mccr8
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
2024-04-22 17:13:24 +00:00
Nika Layzell
de742b93d4 Bug 1875528 - Part 5: Make BackgroundChildImpl threadsafe refcounted, r=ipc-reviewers,mccr8
While the BackgroundChildImpl actor is not safe to use from any thread other
than the one it was created on, it holds no important thread-bound members at
destruction time, and does no meaningful work in its destructor.

Actors managed by BackgroundChild are occasionally kept alive longer than the
thread they were bound to, meaning that the new Manager() strong reference
would keep BackgroundChildImpl alive past the death of its thread and IPC link.
This change makes the reference counting threadsafe, so that it's OK to destroy
these final references from another thread.

Differential Revision: https://phabricator.services.mozilla.com/D198628
2024-04-22 17:13:24 +00:00
Nika Layzell
1b28f9f085 Bug 1875528 - Part 1: Make IProtocol hold a strong reference to manager, r=ipc-reviewers,mccr8
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
2024-04-22 17:13:22 +00:00
Nika Layzell
d6f93a4aa7 Bug 1879375 - Ensure IPDL actors are notified of peer node destruction, r=ipc-reviewers,mccr8
Suppose we have 3 nodes: A, B, and C. In this scenario A is the broker,
and there are two child-nodes B and C. A creates a port-pair (Ab <->
Ac), and sends one each to B (Ab => Bb) and C (Ac => Cc). Assuming both
directions of the proxy bypass occur concurrently, we'll send a number
of ObserveProxy messages between node A and nodes B/C, eventually
cleaning up the proxies in A, such that Bb's peer is Cc, and vice versa.
During this process, we never attempt to send a message directly between
nodes B and C.

In NodeController, direct connections between a pair of nodes are
established via the broker node when attempting to send a message
directly between nodes, but as we have not attempted to send any
messages directly, no such connection has been established. That means
that when one of these child nodes dies, the other node will not be
notified of the peer being lost, and the IPDL actor will appear to
remain open. Only once a message is sent will the death of the peer node
be discovered, and the corresponding actor destroyed.

To fix this, we modify the routing code, adding a couple of callbacks
when accepting ports over IPC and bypassing proxies which notify
NodeController, allowing it to attempt an introduction eagerly. This
helps ensure that actors will reliably be notified when their peer
processes die.

In addition, some tweaks to the introduction logic were made to both
make introductions happen reliably, and to ensure we clean up missing
peer nodes in error conditions.

Differential Revision: https://phabricator.services.mozilla.com/D201153
2024-04-22 16:27:38 +00:00
Sylvestre Ledru
21f973ed5c Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D207867
2024-04-22 16:00:09 +00:00
Yannis Juglaret
ebe4314873 Backed out changeset 98eadcb92105 (Bug 1878993) for causing bug 1892612. r=#win-reviewers CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D208112
2024-04-22 09:39:15 +00:00
Christian Holler (:decoder)
5a7f33de56 Bug 1883107 - Limit MessageTask blocking in fuzzing. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D207715
2024-04-19 15:28:19 +00:00
serge-sans-paille
f14b76b090 Bug 1890722 - Correctly track generation of ipdl files r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D207115
2024-04-16 06:52:32 +00:00
Nika Layzell
fe5df0abfe Bug 1887870 - Reduce the number of mutexes used by mojo in TSAN builds, r=ipc-reviewers,mccr8
This changes the locking behaviour for IPC port mutexes in TSAN builds
to use a single shared mutex for all ports, rather than individual
mutexes per-port. This avoids the need to potentially lock a large
number of mutexes simultaneously when sending a large number of ports in
an IPC message.

I've tried to leave in the various debug assertions such that it still
acts like there are multiple mutexes under the hood. It is likely that
this could harm performance somewhat due to the increased contention,
however it should have no impact on actual release builds.

Differential Revision: https://phabricator.services.mozilla.com/D207073
2024-04-09 20:16:53 +00:00
Emilio Cobos Álvarez
e4ddf24147 Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen
Sorry for the massive patch but I found it hard to split without
introducing a bunch of copies around...

This mostly makes necko and DOM agree on which strings to use, which
should result on less copies and conversions.

Differential Revision: https://phabricator.services.mozilla.com/D205601
2024-04-04 11:49:57 +00:00
Andrew McCreight
07a82f8cc7 Bug 1888936 - Fix two issues with UniquePtr in IPDL. r=ipc-reviewers,nika
The IPDL union name needs to be a valid C++ identifier.

We need to look inside a UniquePtr to find type dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D206259
2024-04-01 19:50:57 +00:00
Otto Länd
68801409a8 Bug 1881636: apply code formatting via Lando
# ignore-this-changeset
2024-03-26 22:59:25 +00:00
Nika Layzell
ec4f15a4eb Bug 1881636 - Part 3: Implement IosProcessLauncher::DoLaunch. r=glandium,ipc-reviewers,jld
This uses BrowserEngineKit's ExtensionKit-based processes to start content
processes on iOS. These processes are started with an initial xpc connection,
which is then used to communicate a command line, initial file descriptors
and environment variables before invoking content_process_main.

The XPC connection is not used further after the bootstrap message, which seems
to roughly match how WebKit uses these APIs.

Differential Revision: https://phabricator.services.mozilla.com/D202525
2024-03-26 22:56:27 +00:00
Mike Hommey
1848f66b3b Bug 1881636 - Part 2 - Expose SetClientChannelFd, SetPrefsFd and SetPrefMapFd on iOS. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D205270
2024-03-26 22:56:26 +00:00
alwu
c560dfa1f4 Bug 1868482 - part3 : ensure HDCP2.2 compatible would be vaild when the flag contains 'CapabilitesFlag::NeedHDCPCheck'. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D205394
2024-03-26 01:28:30 +00:00
Cristian Tuns
0186696113 Backed out 8 changesets (bug 1883784, bug 1868482) for causing bc failures in /ipc/EnumSerializer.h CLOSED TREE
Backed out changeset 38d3d0010972 (bug 1868482)
Backed out changeset 72de2a649e60 (bug 1868482)
Backed out changeset 5849055ce485 (bug 1868482)
Backed out changeset 396b76ded255 (bug 1883784)
Backed out changeset 3974723c71be (bug 1883784)
Backed out changeset c569adae327d (bug 1883784)
Backed out changeset 8f1acf9322b9 (bug 1883784)
Backed out changeset e112d7db9cbb (bug 1883784)
2024-03-23 02:23:28 -04:00
alwu
2927836b40 Bug 1868482 - part3 : ensure HDCP2.2 compatible would be vaild when the flag contains 'CapabilitesFlag::NeedHDCPCheck'. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D205394
2024-03-23 04:22:37 +00:00
pstanciu
08b840a63f Backed out 8 changesets (bug 1868482, bug 1883784) for causing build bustages on MFCDMParent.cpp CLOSED TREE
Backed out changeset 4f65f68ee848 (bug 1868482)
Backed out changeset 44f7868b7c85 (bug 1868482)
Backed out changeset 9eebfe985d87 (bug 1868482)
Backed out changeset 583a6e5b34d4 (bug 1883784)
Backed out changeset 6a72ba930bd7 (bug 1883784)
Backed out changeset d7ec6f631e8d (bug 1883784)
Backed out changeset b5794c5f581e (bug 1883784)
Backed out changeset c5746d7c29ac (bug 1883784)
2024-03-23 04:47:38 +02:00
alwu
ede1527464 Bug 1868482 - part3 : ensure HDCP2.2 compatible would be vaild when the flag contains 'CapabilitesFlag::NeedHDCPCheck'. r=jolin
Depends on D205393

Differential Revision: https://phabricator.services.mozilla.com/D205394
2024-03-22 20:27:20 +00:00
Cosmin Sabou
04a282cb4b Backed out 2 changesets (bug 1886607) for causing build bustages on ChromeUtils.
Backed out changeset 2fa193524f2c (bug 1886607)
Backed out changeset f77ff6043d75 (bug 1886607)
2024-03-22 00:28:44 +02:00
Sandor Molnar
552c67b1b1 Bug 1886607 - Fix ios build bustages @ dom/base/ChromeUtils.cpp a=fix CLOSED TREE 2024-03-21 23:54:12 +02:00
Kelsey Gilbert
666d6cb34e Bug 1886214 - Cache PWebGL::IsEnabled. r=gfx-reviewers,lsalzman,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D205091
2024-03-21 17:37:41 +00:00
Alex
7f8d271a8c Bug 1886471 - Fix racy TestHangsHang test r=ipc-reviewers,nika
This is very likely to address the cause of the intermittent failure.

Differential Revision: https://phabricator.services.mozilla.com/D205246
2024-03-21 14:20:45 +00:00
Barret Rennie
81a6b069cf Bug 1885948 - Pass IPDL sources to ipdl.py in a text file r=nika,ahochheiden
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
2024-03-20 14:58:53 +00:00
Alex
64550316b7 Bug 1729044 - Remove ipdl support for intr r=ipc-reviewers,nika
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
2024-03-20 14:28:15 +00:00
Jed Davis
1dcd15d26b Bug 1881386 - Check for zombie processes in ProcessWatcher on Linux. r=glandium
This patch checks whether child processes are in the zombie state
(`exit`ed but not `wait`ed), by parsing `/proc/{pid}/stat`, and treats
them as dead in that case.

Child processes can end up stuck in zombie state if the fork server
exits when child processes are still running, which causes them to be
reparented to pid 1, and pid 1 isn't acting as `init`, which can happen
in container environments like Docker depending on configuration.  In
particular, this is currently the case in the containers used by Mozilla
CI to run tests.  Without this patch, if the fork server is enabled, we
wait forever for the process to exit and then (in the Mozilla CI case)
some other timeout fires and causes the test run to fail.

Differential Revision: https://phabricator.services.mozilla.com/D204096
2024-03-19 21:05:40 +00:00
Alex
f50b261d13 Bug 1746288 - Remove intr from IPDL tests r=ipc-reviewers,nika
Some tests had `intr` as a means of having the most restricted protocol
type; those were downgraded to `sync`.

Differential Revision: https://phabricator.services.mozilla.com/D204783
2024-03-19 13:21:15 +00:00
Natalia Csoregi
a1e84a49ec Backed out changeset a1428617e87a (bug 1885948) for causing mbu failures. CLOSED TREE 2024-03-19 07:50:34 +02:00
Barret Rennie
541f3fc622 Bug 1885948 - Pass IPDL sources to ipdl.py in a text file r=nika,ahochheiden
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
2024-03-18 20:03:13 +00:00
Iulian Moraru
39646463bc Backed out changeset 8a9b63318958 (bug 1729044) for causing linux build bustages. CLOSED TREE 2024-03-19 04:58:49 +02:00
Alex
28e7b97eeb Bug 1729044 - Remove ipdl support for intr r=ipc-reviewers,nika
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
2024-03-18 17:23:26 +00:00
Alex
6c8a0020a5 Bug 1236717 - Remove unused/unmigrated IPDL tests r=ipc-reviewers,nika
The tests we want to keep have been migrated to gtests and are run by
default.

Differential Revision: https://phabricator.services.mozilla.com/D204818
2024-03-18 17:12:25 +00:00
Alex
b9343c37c9 Bug 1885018 - Remove unnecessary generation code in the IPDL compiler r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D204657
2024-03-15 15:10:33 +00:00
Alex
19fb5724a7 Bug 1885018 - Disallow sync and return values in destructors r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D204656
2024-03-15 15:10:32 +00:00
Mike Hommey
fe9b75aae1 Bug 1884031 - Put UTILITY_AUDIO_DECODING_APPLE_MEDIA tests behind MOZ_APPLEMEDIA. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D203848
2024-03-14 21:04:39 +00:00
Edgar Chen
fdaf5ca11a Bug 1858627 - Update DataTransfer to utilize GetDataSnapshotSync() for retrieving clipboard formats; r=nika,ipc-reviewers
The actual data retrieval continues to use the original method.

Differential Revision: https://phabricator.services.mozilla.com/D202351
2024-03-13 20:44:06 +00:00
Edgar Chen
239696f93b Bug 1858627 - Add nsIClipboard API to return nsIAsyncSetClipboardData synchrously; r=ipc-reviewers,nika
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
2024-03-13 20:44:06 +00:00
alwu
973db5e9bc Bug 1884719 - part1 : init gfxVar when creating a UtilityAudioDecoderParent. r=gerard-majax
Move initializing gfxVar from creating a video bridge to the moment we
create UtilityAudioDecoderParent in order to ensure that we can always
get correct value from gfxVar.

Differential Revision: https://phabricator.services.mozilla.com/D204292
2024-03-13 17:58:03 +00:00
Alex Franchuk
1d4418517f Bug 1751995 - Remove TestUrgentHangs r=ipc-reviewers,nika
This seemed like a lot of effort to port with little gain, since it's testing sync/cpow message
things.

Differential Revision: https://phabricator.services.mozilla.com/D202265
2024-03-13 13:10:25 +00:00
Alex Franchuk
4733f46b7c Bug 1751995 - Migrate TestUrgency r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D202264
2024-03-13 13:10:25 +00:00
Alex Franchuk
d0bb4eb142 Bug 1751995 - Migrate TestUniquePtrIPC r=ipc-reviewers,nika
Some of the assertions were changed because the message arguments are passed by const reference.
`MoveOnly` is applied to specific types, and UniquePtr is a built-in so we can't adjust that.

Differential Revision: https://phabricator.services.mozilla.com/D202263
2024-03-13 13:10:24 +00:00
Alex Franchuk
dd17f3a6e5 Bug 1751995 - Remove TestSyncWakeup r=ipc-reviewers,nika
This relies on interrupt messages.

Differential Revision: https://phabricator.services.mozilla.com/D202262
2024-03-13 13:10:24 +00:00
Alex Franchuk
fcc88c75c1 Bug 1751995 - Remove TestSyncHang r=ipc-reviewers,nika
This relies on launching additional child processes.

Differential Revision: https://phabricator.services.mozilla.com/D202261
2024-03-13 13:10:23 +00:00
Alex Franchuk
a7a6fd3230 Bug 1751995 - Migrate TestSyncError r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D202260
2024-03-13 13:10:23 +00:00
Alex Franchuk
6943de4e7b Bug 1751995 - Remove TestStackHooks r=ipc-reviewers,nika
This tests how interrupt calls occur relative to others.

Differential Revision: https://phabricator.services.mozilla.com/D202259
2024-03-13 13:10:23 +00:00