Commit Graph

8192 Commits

Author SHA1 Message Date
Christian Holler (:decoder)
e0ae53527b Bug 1896638 - Export some IPDL information as JSON. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D210326
2024-06-07 10:22:48 +00:00
Gregory Pappas
cbbb4fb827 Bug 1900879 - part 1: Remove unused MessageChannel::SpinInternalEventLoop r=ipc-reviewers,nika
It's not used since bug 1751047

Differential Revision: https://phabricator.services.mozilla.com/D212742
2024-06-06 20:19:19 +00:00
Jed Davis
68fdfb66c4 Bug 1837550 - Re-enable tests. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D212643
2024-06-06 02:15:18 +00:00
Jed Davis
e2a4fdb72f Bug 1837550 - Clean up control flow in WaitableEvent. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D212642
2024-06-06 02:15:18 +00:00
Dana Keeler
777066906a Bug 1900132 - streamline PVerifySSLServerCert protocol r=jschanck
Previously the PVerifySSLServerCert protocol consisted of two functions: one to
call when certificate verification succeeded, and another to call upon failure.
This was unnecessary, as the code before and after this protocol didn't have
the same split. This patch unifies the protocol to better match the surrounding
code. It also takes the opportunity to make use of some IPC helpers to
serialize enums rather than manually casting to and from basic integer types.

Differential Revision: https://phabricator.services.mozilla.com/D212594
2024-06-05 23:58:02 +00:00
Otto Länd
ee23dcd890 Bug 1884221, 1895375: apply code formatting via Lando
# ignore-this-changeset
2024-05-30 18:30:24 +00:00
Ray Kraesig
fce1a86177 Bug 1895375 - [4/4] Propagate ipc::LaunchErrors to callers r=ipc-reviewers,nika
* Adjust UtilityProcess{Host,Manager} to propagate ipc::LaunchErrors for
  their clients, or to create new ones where none previously existed.

* Adjust the various clients of the above to to handle the additional
  information -- mostly by adding the additional failure-location data
  to log messages.

* Fix an unrelated bug wherein the return type of `LaunchProcess` was
  declared as exclusive, despite being cached and reused.

In particular, filedialog::Error objects should now contain -- and report
to telemetry without further adjustment -- the actual error code from
`ipc::LaunchError`s.

(Reporting the original failure location as well will occur in bug
1884221.)

Differential Revision: https://phabricator.services.mozilla.com/D209715
2024-05-30 17:52:09 +00:00
Ray Kraesig
f6411a2366 Bug 1895375 - [1/4] Adjust types associated with ipc::LaunchError r=ipc-reviewers,win-reviewers,gstoll,nika
As the intended use for LaunchError::mFunction is telemetry, avoid the
possibility of accidental exfiltration of PII by requiring that
LaunchError be constructed from `StaticString`.

Additionally, remove the Windows-specific constructor overloads in favor
of an explicit factory function, and explicitly document that `mError`
is a generic bag of bits rather than any kind of strict error type.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D209712
2024-05-30 17:52:07 +00:00
alwu
6a5f6b7c2a Bug 1898588 - part5 : remove encryption scheme per key system. r=jolin
As we've added encryption scheme per content type in previous patches,
there is no need to keep this old encryption scheme.

Differential Revision: https://phabricator.services.mozilla.com/D211793
2024-05-29 18:27:04 +00:00
alwu
01ff3ac17a Bug 1898588 - part2 : remove duplicated method 'EncryptionSchemeStr'. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D211643
2024-05-29 18:27:03 +00:00
alwu
7560a3726d Bug 1898588 - part1 : add encryptionSchemes in MFCDMMediaCapability in order to support scheme per type r=jolin
Currently our implementation is the scheme support per key system,
not per content type. As each content type can have different supported
scheme, eg. type A only supports cenc, but type B only supports cbcs,
only having scheme per key system can't return a precise result.

Differential Revision: https://phabricator.services.mozilla.com/D211642
2024-05-29 18:27:03 +00:00
Narcis Beleuzu
0cf79ef540 Backed out 5 changesets (bug 1898588) for bustages on MediaData.cpp . CLOSED TREE
Backed out changeset d23ba62a5165 (bug 1898588)
Backed out changeset dd7a777b034f (bug 1898588)
Backed out changeset 62c4a3361e00 (bug 1898588)
Backed out changeset 2643cfcd1ba7 (bug 1898588)
Backed out changeset 940fca861f93 (bug 1898588)
2024-05-29 02:15:25 +03:00
alwu
a865b4d648 Bug 1898588 - part5 : remove encryption scheme per key system. r=jolin
As we've added encryption scheme per content type in previous patches,
there is no need to keep this old encryption scheme.

Differential Revision: https://phabricator.services.mozilla.com/D211793
2024-05-28 21:10:39 +00:00
alwu
e794fecb4e Bug 1898588 - part2 : remove duplicated method 'EncryptionSchemeStr'. r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D211643
2024-05-28 21:10:38 +00:00
alwu
8f5cfaebbf Bug 1898588 - part1 : add encryptionSchemes in MFCDMMediaCapability in order to support scheme per type r=jolin
Currently our implementation is the scheme support per key system,
not per content type. As each content type can have different supported
scheme, eg. type A only supports cenc, but type B only supports cbcs,
only having scheme per key system can't return a precise result.

Differential Revision: https://phabricator.services.mozilla.com/D211642
2024-05-28 21:10:38 +00:00
Cristian Tuns
fc392b89ab Backed out changeset 9b708a1dc402 (bug 1890748) for causing bc failures in browser_permission_delegate_geo.js CLOSED TREE 2024-05-27 12:25:10 -04:00
Andreas Farre
ec8d5be38a Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-05-27 10:06:58 +00:00
Butkovits Atila
f967675ec8 Backed out changeset a710fd347db2 (bug 1890748) for causing bustages at Document.cpp. CLOSED TREE 2024-05-24 18:06:30 +03:00
Andreas Farre
031a90d97c Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-05-24 14:28:47 +00:00
Gabriele Svelto
80f0c61cf5 Bug 1896650 - Remove sequence numbers from crash reports r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D210309
2024-05-21 19:58:18 +00:00
serge-sans-paille
a1106cbc85 Bug 1883720 - (re)Move checks for socket, gethostbyname_r and demangle to moz.configure r=glandium
Actually remove the check for demangle, no supported target need that
check.

Also make library dependencies explicit instead of relying on "$LIBS".

Differential Revision: https://phabricator.services.mozilla.com/D203637
2024-05-17 07:35:09 +00:00
Nika Layzell
20ef7e892a Bug 1895358 - Part 2: Handle ManagedContainer membership more centrally, r=ipc-reviewers,mccr8
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
2024-05-15 20:36:28 +00:00
Nika Layzell
4388b2bf77 Bug 1895358 - Part 1: Improve formatting of long multiline argument lists, r=ipc-reviewers,mccr8
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
2024-05-15 20:36:28 +00:00
Nika Layzell
711b38a835 Bug 1892652 - Part 2: Note if shmem allocation failed in message size too large crashes, r=ipc-reviewers,jld
In part 1, a fallback was added to allow message buffers which would be sent as
shmem to be sent inline if shmem allocation or mapping failed. This could
potentially lead to an increase in message size too large crashes, as these
messages are now being sent inline again.

This patch adds an extra crash annotaion such that failures of this kind can be
identified in socorro.

Depends on D209880

Differential Revision: https://phabricator.services.mozilla.com/D209881
2024-05-15 16:33:26 +00:00
Nika Layzell
7811e94313 Bug 1892652 - Part 1: Fall back to sending buffer data inline if shmem allocation fails, r=ipc-reviewers,jld
This may help reduce crashes in some cases, especially on 32-bit machines which
may be suffering from severe memory fragmentation. This required serializing
extra information for large buffers which would be sent as a shmem to record if
the shmem allocation succeeded or failed on the sending side.

Differential Revision: https://phabricator.services.mozilla.com/D209880
2024-05-15 16:33:26 +00:00
Tamas Szentpeteri
22c92af506 Backed out 3 changesets (bug 1883720, bug 1883719, bug 1883615) for causing multiple failures. CLOSED TREE
Backed out changeset 495b9e84ba9d (bug 1883720)
Backed out changeset 5a89cbc54dd2 (bug 1883615)
Backed out changeset 9d075e352b0e (bug 1883719)
2024-05-15 13:30:17 +03:00
serge-sans-paille
ceff7deb44 Bug 1883720 - (re)Move checks for socket, gethostbyname_r and demangle to moz.configure r=glandium
Actually remove the check for demangle, no supported target need that
check.

Also make library dependencies explicit instead of relying on "$LIBS".

Differential Revision: https://phabricator.services.mozilla.com/D203637
2024-05-15 07:47:56 +00:00
Jamie Nicol
0056a7ee56 Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.

This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().

As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).

As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.

Differential Revision: https://phabricator.services.mozilla.com/D202166
2024-05-14 12:58:35 +00:00
Stanca Serban
ad459e5cb0 Backed out 3 changesets (bug 1880503) for causing build bustages in nsCOMPtr.h. CLOSED TREE
Backed out changeset 437063345a7b (bug 1880503)
Backed out changeset 9665aa5e821d (bug 1880503)
Backed out changeset 44d08ce97ae6 (bug 1880503)
2024-05-13 21:08:49 +03:00
Jamie Nicol
6e07140f91 Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.

This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().

As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).

As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.

Differential Revision: https://phabricator.services.mozilla.com/D202166
2024-05-13 16:52:12 +00:00
Jon Coppeard
e38e561b0a Bug 1895661 - Part 1: Move GC zeal functions to JS namespace and add separate constants for browser and shell frequency r=sfink
Sensible defaults are very different for the browser and the shell so I added
separate constants. I think the JS testing functions can get called from the
browser and so may pick the wrong default but it's not too serious.

Differential Revision: https://phabricator.services.mozilla.com/D210058
2024-05-13 16:31:20 +00:00
Nika Layzell
640fc273cd Bug 1892799 - Remove incorrect assertion, r=ipc-reviewers,mccr8
In the changes from bug 1879375, the conditions for entries to be added
to mPendingMessages was changed, such that it is now possible for the
broker to temporarily have empty entries in this table. This means the
assertion is no longer correct and should be removed.

Differential Revision: https://phabricator.services.mozilla.com/D209861
2024-05-08 20:31:47 +00:00
Sean
a32dab7f88 Bug 1860565 - Serialize and Deserialize LinkHeader::mAnchor in IPCMessageUtilsSpecializations.h r=manuel
Differential Revision: https://phabricator.services.mozilla.com/D209454
2024-05-06 16:59:44 +00:00
Nika Layzell
0822a33b42 Bug 1893150 - Handle actor id registration errors more explicitly, r=ipc-reviewers,mccr8
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
2024-05-03 17:21:16 +00:00
serge-sans-paille
967c226657 Bug 1890817 - Run ipdl.py in distributed r=nika
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
2024-05-03 08:08:07 +00:00
Ryan VanderMeulen
0e07c8c08e Bug 1806946 - Skip GTests which fail when run under TSAN. r=profiler-reviewers,dom-storage-reviewers,tnikkel,xpcom-reviewers,ipc-reviewers,mccr8,janv,webrtc-reviewers,pehrsons,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D209175
2024-05-02 13:09:07 +00:00
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