Commit Graph

256 Commits

Author SHA1 Message Date
Mike Hommey
61f6597ef5 Bug 1883565 - Use ProcessUtils_none.cpp on iOS. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D203556
2024-03-05 22:41:32 +00:00
Landry Breuil
b56f46c4ab Bug 1854775: fix build on *BSD after bug 1851095 r=jld
Differential Revision: https://phabricator.services.mozilla.com/D189112
2023-09-25 23:46:48 +00:00
Jed Davis
df9fa90f41 Bug 1851095 - Step 2: Connect setproctitle to the fork server. r=nika
This adds a small function that concatenates the args (because not
only does the BSD `setproctitle` take a single string, but also the
Linux kernel code that implements `/proc/{pid}/cmdline` won't allow the
"arguments" to extend past their original length unless it's a single
string), and connects it to the fork server.

Differential Revision: https://phabricator.services.mozilla.com/D187635
2023-09-22 03:41:39 +00:00
Lee Salzman
f793972d4c Bug 1553691 - Implement CrossProcessSemaphore on macOS using Mach semaphores. r=nika
Unnamed POSIX semaphores are not supported on macOS, nor is timed wait supported on
named POSIX semaphores. SysV semaphores have similar limitations.

Mach semaphores are one of the only clean ways to create unnamed, shareable semaphores
on macOS. As of bug 1734735, we now can transparently send the mach ports across to
other processes without much added code, overall making this implementation of Mach
semaphores fairly easy.

Differential Revision: https://phabricator.services.mozilla.com/D188429
2023-09-19 21:16:46 +00:00
Nika Layzell
aa962084cc Bug 1454808 - Remove SharedMemoryBasic_android, r=jld
The special handling for android is in chromium's SharedMemory type,
meaning we can use SharedMemoryBasic_chromium now on Android.

This patch removes the android special casing to use the chromium
backend on that platform as well.

Differential Revision: https://phabricator.services.mozilla.com/D182808
2023-07-20 20:23:41 +00:00
Masatoshi Kimura
181d1d2914 Bug 1844257 - Remove ipc/glue/LibrarySandboxPreload.(cpp|h). r=glandium
They are leftovers from bug 1572618 and bug 1737733.

Differential Revision: https://phabricator.services.mozilla.com/D183973
2023-07-19 23:29:19 +00:00
Alexandre Lissy
a9ee883ccf Bug 1839834 - Allow per-sandbox disabling on Utility r=jld
Differential Revision: https://phabricator.services.mozilla.com/D181782
2023-06-27 13:10:14 +00:00
Norisz Fay
53d9f9072c Backed out changeset 38a62f7736e9 (bug 1839834) for causing sandboxing related Gtest failures CLOSED TREE 2023-06-26 20:04:59 +03:00
Alexandre Lissy
be3bdb474b Bug 1839834 - Allow per-sandbox disabling on Utility r=jld
Differential Revision: https://phabricator.services.mozilla.com/D181782
2023-06-26 14:47:33 +00:00
Haik Aftandilian
91fff12722 Bug 1827747 - Use a new executable for the macOS GMP process r=nika,glandium
Use a new executable for the GMP process named "<App Name> Media Plugin Helper" so that the content processes (using the plugin-container executable) and the GMP process can be signed with different entitlements allowing for the use of more secure entitlements.

In order for the new executable to load the Widevine plugin, a change is needed in the codesigning infrastructure repo to generate the .sig file for the new executable.

To get the security benefits of using a new executable for GMP, additional changes are needed in the codesigning infrastructure repo to enable signing plugin-container and the new executable with a reduced set of entitlements.

The executable is a copy of plugin-container renamed as "<App Name> Media Plugin Helper" so it appears with a user friendly name in Activity Monitor. For example, "Firefox Media Plugin Helper". (The GMP process runs with limited privileges preventing it from setting its own "nice" process name.)

Pref off the change until the .sig file change lands and media playback has been validated on production builds.

Differential Revision: https://phabricator.services.mozilla.com/D175796
2023-06-05 20:40:10 +00:00
Andreas Pehrson
314619d186 Bug 1826530 - Implement MessagePumpForNonMainUIThreads for mac. r=xpcom-reviewers,ipc-reviewers,mstange,nika
The MessagePump implemented here is a MessagePumpCFRunLoopBase that also handles
xpcom events.

Differential Revision: https://phabricator.services.mozilla.com/D175101
2023-05-23 09:05:07 +00:00
Andreas Pehrson
78cd1b249f Bug 1826530 - Break platform-dependent MessagePumps out to platform-specific files. r=ipc-reviewers,nika
This makes things a bit clearer when adding the mac implementation.

Differential Revision: https://phabricator.services.mozilla.com/D175100
2023-05-23 09:05:07 +00:00
Noemi Erli
901cf51122 Backed out 4 changesets (bug 1826530) for causing build bustages in MessagePump_android.cpp CLOSED TREE
Backed out changeset 027080336f71 (bug 1826530)
Backed out changeset 2174d8d45249 (bug 1826530)
Backed out changeset fe9e6fccc2e6 (bug 1826530)
Backed out changeset 2534ba3f140f (bug 1826530)
2023-05-23 10:13:17 +03:00
Andreas Pehrson
e600cfbf57 Bug 1826530 - Implement MessagePumpForNonMainUIThreads for mac. r=xpcom-reviewers,ipc-reviewers,mstange,nika
The MessagePump implemented here is a MessagePumpCFRunLoopBase that also handles
xpcom events.

Differential Revision: https://phabricator.services.mozilla.com/D175101
2023-05-23 06:51:53 +00:00
Andreas Pehrson
919c5ee057 Bug 1826530 - Break platform-dependent MessagePumps out to platform-specific files. r=ipc-reviewers,nika
This makes things a bit clearer when adding the mac implementation.

Differential Revision: https://phabricator.services.mozilla.com/D175100
2023-05-23 06:51:53 +00:00
Narcis Beleuzu
7e5789cdf8 Backed out 2 changesets (bug 1834172, bug 1827747) for breaking local artifacts . a=backout
Backed out changeset 0ceb457743b4 (bug 1834172)
Backed out changeset 7ad6a3ad9db7 (bug 1827747)
2023-05-22 12:42:00 +03:00
Haik Aftandilian
a34208222c Bug 1827747 - Use a new executable for the macOS GMP process r=nika,glandium
Use a new executable for the GMP process named "<App Name> Media Plugin Helper" so that the content processes (using the plugin-container executable) and the GMP process can be signed with different entitlements allowing for the use of more secure entitlements.

To get the benefits of using a new executable for GMP, additional changes are needed in the codesigning infrastructure repo to enable signing plugin-container and the new executable with a reduced set of entitlements.

The executable is built as media-plugin-helper and then renamed to "<App Name> Media Plugin Helper" so it appears with a user friendly name in Activity Monitor. For example, "Firefox Media Plugin Helper". (The GMP process runs with limited privileges preventing it from setting its own "nice" process name.)

Limit the change to Nightly at this time to allow validation of using a new executable and then enabling the strong entitlements.

Differential Revision: https://phabricator.services.mozilla.com/D175796
2023-05-19 16:47:28 +00:00
Alexandre Lissy
dfe03ada47 Bug 1832108 - Collect Utility audio decoder actor name r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D177516
2023-05-10 09:34:15 +00:00
Alexandre Lissy
32a6eaf06f Bug 1819311 - Collect errors on process launch r=nika,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D171226
2023-04-13 08:35:24 +00:00
Nika Layzell
fc898b85f5 Bug 1814683 - Part 4: Allow IPDL structs to contain non-default-constructable types, r=ipc-reviewers,jld
Previously, we would always generate a default constructor for IPDL structs
which explicitly initializes every member. This would require members to have
default initializers statically. With the new approach, each member is
individually wrapped with a template parameter which will try to ensure value
initiaization, and the default constructor is implemented with `= default;`.

The default constructor will produce a warning on clang if it is implicitly
deleted, so that warning is also suppressed.

Differential Revision: https://phabricator.services.mozilla.com/D168881
2023-03-20 15:40:34 +00:00
Nika Layzell
78fa962afb Bug 1814683 - Part 1: Combine parent/child fields in IPDL structs/unions, r=ipc-reviewers,necko-reviewers,mccr8
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.

This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.

Differential Revision: https://phabricator.services.mozilla.com/D168879
2023-03-20 15:40:31 +00:00
Iulian Moraru
801dae8f2c Backed out 14 changesets (bug 1607634, bug 1814683, bug 1815177, bug 1814686) for causing build bustages on MaybeStorageBase. CLOSED TREE
Backed out changeset ae1c0551cea5 (bug 1815177)
Backed out changeset a11cafaa1884 (bug 1814686)
Backed out changeset 621507521762 (bug 1814686)
Backed out changeset ad692c73e381 (bug 1814686)
Backed out changeset 3be031e503dc (bug 1607634)
Backed out changeset aebbaa145d2d (bug 1607634)
Backed out changeset 9aa1f346fe14 (bug 1607634)
Backed out changeset e3eb77ad55ca (bug 1607634)
Backed out changeset e60591e5d5cf (bug 1607634)
Backed out changeset 6e43042d204a (bug 1814683)
Backed out changeset 1706e88652d6 (bug 1814683)
Backed out changeset 6878a1590e91 (bug 1814683)
Backed out changeset b1c980c834d8 (bug 1814683)
Backed out changeset 94480b82d102 (bug 1814683)
2023-03-15 01:58:36 +02:00
Nika Layzell
11639b965c Bug 1814683 - Part 4: Allow IPDL structs to contain non-default-constructable types, r=ipc-reviewers,jld
Previously, we would always generate a default constructor for IPDL structs
which explicitly initializes every member. This would require members to have
default initializers statically. With the new approach, each member is
individually wrapped with a template parameter which will try to ensure value
initiaization, and the default constructor is implemented with `= default;`.

The default constructor will produce a warning on clang if it is implicitly
deleted, so that warning is also suppressed.

Differential Revision: https://phabricator.services.mozilla.com/D168881
2023-03-14 19:31:38 +00:00
Nika Layzell
97577629c0 Bug 1814683 - Part 1: Combine parent/child fields in IPDL structs/unions, r=ipc-reviewers,necko-reviewers,mccr8
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.

This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.

Differential Revision: https://phabricator.services.mozilla.com/D168879
2023-03-14 19:31:36 +00:00
Emilio Cobos Álvarez
3d092ba60e Bug 1775062 - Implement ipdl reads without needing default ctors. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D149743
2023-02-04 11:12:36 +00:00
Chris Martin
cfcb9fcb81 Bug 1799470 - Merge old embedding logic into ContentChild r=nika
Differential Revision: https://phabricator.services.mozilla.com/D164596
2022-12-15 03:06:22 +00:00
Nicolas Silva
a1971c2e74 Bug 1795311 - A new shared memory class with more flexible memory management. r=nika,jld
Differential Revision: https://phabricator.services.mozilla.com/D159398
2022-11-10 15:52:31 +00:00
Cristian Tuns
239d775bde Backed out 2 changesets (bug 1795311) for causing build bustages on WebGPUParent.cpp CLOSED TREE
Backed out changeset 71697f876d88 (bug 1795311)
Backed out changeset 60b9bfda2e8b (bug 1795311)
2022-11-09 11:17:43 -05:00
Nicolas Silva
29b09614fe Bug 1795311 - A new shared memory class with more flexible memory management. r=nika,jld
Differential Revision: https://phabricator.services.mozilla.com/D159398
2022-11-09 14:30:14 +00:00
Jan Varga
b1ffbdb845 Bug 1791734 - Add nsIRandomAccessStream serialization support; r=ipc-reviewers,necko-reviewers,dom-storage-reviewers,nika,jesup
Only nsFileRandomAccessStream is supported for now.

Differential Revision: https://phabricator.services.mozilla.com/D157794
2022-10-27 16:12:30 +00:00
Nika Layzell
1c5879a78a Bug 1783242 - Part 1: Serialize large JSStructuredCloneData with SharedMemory, r=ipc-reviewers,handyman
This changes the serialization strategy for JSStructuredCloneData to use shared
memory if the total size exceeds 64k. This doesn't change how it is represented
when it is within source or destination processes, just how it is represented
when in transit.

Differential Revision: https://phabricator.services.mozilla.com/D153804
2022-09-28 19:25:13 +00:00
Nika Layzell
83fc37ceec Bug 1783240 - Part 2: Automatically serialize large blocks of binary data in shared memory, r=ipc-reviewers,jld
This changes and unifies the serialization strategy for types like
`ns[C]String`, `nsTArray<T>`, `std::vector<T>` etc such that they are all
serialized using a common implementation. For types which are trivial to
transfer with `memcpy`, they will automatically be serialized into a shared
memory region and copied out on the other side if its size exceeds 64k.

Differential Revision: https://phabricator.services.mozilla.com/D153803
2022-09-28 19:25:12 +00:00
alwu
3d1bc29d56 Bug 1785738 - part4 : run media engine in the new utility process. r=gerard-majax,azebrowski
This patch moves the media engine from the RDD process to the new
utility process, and create video bridge between the new utility process
and the GPU process in order to share the texture.

Differential Revision: https://phabricator.services.mozilla.com/D155901
2022-09-03 00:53:59 +00:00
Nika Layzell
005eab77f7 Bug 1681359 - Part 1: Introduce the BigBuffer type to IPC, r=ipc-reviewers,jld
This type is inspired by the Chromium BigBuffer type, and acts as a type which
intelligently either allocates a shared memory region or in-memory buffer based
on the size of the payload. The current threshold is 64k bytes, and it can be
somewhat cheaply transferred over IPC.

This is intended to be used in places where we currently create a basic `Shmem`
to transfer a potentially large block of bytes over IPC.

Differential Revision: https://phabricator.services.mozilla.com/D151851
2022-07-26 20:51:25 +00:00
Randell Jesup
7960ef17d7 Bug 1768050: Test request handler. r=jesup
Depends on D147273

Differential Revision: https://phabricator.services.mozilla.com/D149983
2022-07-07 09:08:58 +00:00
Randell Jesup
44a231d591 Bug 1768050: Move OPFS operations off PBackground r=janv,nika
Depends on D149260

Differential Revision: https://phabricator.services.mozilla.com/D147273
2022-07-07 09:08:57 +00:00
Butkovits Atila
c27cc6a9d2 Backed out 2 changesets (bug 1768050) for causing gtest failures complaining about function calls. CLOSED TREE
Backed out changeset 52f54c3384db (bug 1768050)
Backed out changeset a3c7a9041511 (bug 1768050)
2022-07-06 22:13:03 +03:00
Randell Jesup
96bbb1edea Bug 1768050: Test request handler. r=jesup
Depends on D147273

Differential Revision: https://phabricator.services.mozilla.com/D149983
2022-07-06 18:00:04 +00:00
Randell Jesup
3a934f66ac Bug 1768050: Move OPFS operations off PBackground r=janv,nika
Depends on D149260

Differential Revision: https://phabricator.services.mozilla.com/D147273
2022-07-06 18:00:04 +00:00
Nika Layzell
2b307c5cea Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-13 14:16:09 +00:00
Nika Layzell
ef3794b3c5 Bug 1754004 - Part 1: Switch IPCStream to use DataPipe instead of P{ChildToParent,ParentToChild}Stream, r=asuth,necko-reviewers,kershaw
This gives us various positive benefits, such as using a shared memory ring
buffer for faster communication, not having data streaming being bound to the
thread which transferred the nsIInputStream (which is often the main thread),
and the ability for some backpressure to be applied to data streaming.

After this change, the "delayed start" parameter for IPCStream serialization is
less relevant, as backpressure will serve a similar purpose. It will still be
used to determine whether or not to use RemoteLazyInputStream when serializing
from the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D141038
2022-05-13 14:16:09 +00:00
Noemi Erli
45276205df Backed out 22 changesets (bug 1696894, bug 1759569, bug 1754031, bug 1759563, bug 1759572, bug 1754004) for causing leack failures CLOSED TREE
Backed out changeset 673ecd5337e1 (bug 1754004)
Backed out changeset ecbf5f3c51de (bug 1754004)
Backed out changeset fc6c39f56d21 (bug 1754004)
Backed out changeset 5b3d58fbaf9d (bug 1696894)
Backed out changeset 2e56c89cf55d (bug 1754004)
Backed out changeset b7723490f025 (bug 1754004)
Backed out changeset 1dfbf61ff5dd (bug 1754004)
Backed out changeset e73abb071bb3 (bug 1754004)
Backed out changeset f9abe4fbf501 (bug 1754004)
Backed out changeset ee7aeb631cd9 (bug 1754004)
Backed out changeset d66aacfcf983 (bug 1754004)
Backed out changeset 5c2872ad6912 (bug 1754004)
Backed out changeset e1ae48f30d2c (bug 1754004)
Backed out changeset 849b63707d7f (bug 1754004)
Backed out changeset 36563e3b1e04 (bug 1754004)
Backed out changeset ccb4be659107 (bug 1754004)
Backed out changeset 659581d4159b (bug 1754004)
Backed out changeset 611ea76d7a9c (bug 1754004)
Backed out changeset 9b24b561698c (bug 1759572)
Backed out changeset f820e0f209ff (bug 1759563)
Backed out changeset 8d82066fa181 (bug 1759569)
Backed out changeset a2835afab1ad (bug 1754031)
2022-05-11 06:16:25 +03:00
Nika Layzell
728ba534f6 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-10 22:27:42 +00:00
Nika Layzell
f9f3cc6138 Bug 1754004 - Part 1: Switch IPCStream to use DataPipe instead of P{ChildToParent,ParentToChild}Stream, r=asuth,necko-reviewers,kershaw
This gives us various positive benefits, such as using a shared memory ring
buffer for faster communication, not having data streaming being bound to the
thread which transferred the nsIInputStream (which is often the main thread),
and the ability for some backpressure to be applied to data streaming.

After this change, the "delayed start" parameter for IPCStream serialization is
less relevant, as backpressure will serve a similar purpose. It will still be
used to determine whether or not to use RemoteLazyInputStream when serializing
from the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D141038
2022-05-10 22:27:41 +00:00
Noemi Erli
39469989c9 Backed out 22 changesets (bug 1759572, bug 1759563, bug 1754004, bug 1754031, bug 1759569, bug 1696894) for causing multiple failures CLOSED TREE
Backed out changeset d69647a725a1 (bug 1754004)
Backed out changeset 09fc506865d7 (bug 1754004)
Backed out changeset 648e3dd4b62f (bug 1754004)
Backed out changeset 3465158ee230 (bug 1696894)
Backed out changeset b08475bbfbd9 (bug 1754004)
Backed out changeset dfabce587a56 (bug 1754004)
Backed out changeset cebe8d5dda34 (bug 1754004)
Backed out changeset 55b4b0c9a504 (bug 1754004)
Backed out changeset e8649de9dd22 (bug 1754004)
Backed out changeset 0f480fc861c0 (bug 1754004)
Backed out changeset e515b7edd1c8 (bug 1754004)
Backed out changeset fe90db9158ac (bug 1754004)
Backed out changeset c6388d682d48 (bug 1754004)
Backed out changeset 2374420d9fed (bug 1754004)
Backed out changeset 44dfd76472aa (bug 1754004)
Backed out changeset 000fb99de0cf (bug 1754004)
Backed out changeset 0ca1856b5fc9 (bug 1754004)
Backed out changeset 10c3683b998b (bug 1754004)
Backed out changeset 4abc98ed6b99 (bug 1759572)
Backed out changeset cdd271a5af42 (bug 1759563)
Backed out changeset fadb6cc0d81c (bug 1759569)
Backed out changeset 44be9709a93e (bug 1754031)
2022-05-06 04:28:47 +03:00
Nika Layzell
0308ac11a4 Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-05 23:34:21 +00:00
Nika Layzell
3ef777a45c Bug 1754004 - Part 1: Switch IPCStream to use DataPipe instead of P{ChildToParent,ParentToChild}Stream, r=asuth,necko-reviewers,kershaw
This gives us various positive benefits, such as using a shared memory ring
buffer for faster communication, not having data streaming being bound to the
thread which transferred the nsIInputStream (which is often the main thread),
and the ability for some backpressure to be applied to data streaming.

After this change, the "delayed start" parameter for IPCStream serialization is
less relevant, as backpressure will serve a similar purpose. It will still be
used to determine whether or not to use RemoteLazyInputStream when serializing
from the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D141038
2022-05-05 23:34:20 +00:00
Christian Holler
0ccdc33183 Bug 1756778 - Integrate top-level IPC fuzzing. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D139471
2022-05-05 15:39:24 +00:00
Sebastian Hengst
7ddbeea9d6 Backed out 17 changesets (bug 1696894, bug 1754004) for causing crashes e.g. bug 1767808, and hanging Gmail (bug 1767918). a=backout DONTBUILD
Backed out changeset 63f17a06eba9 (bug 1754004)
Backed out changeset 017e1552d549 (bug 1754004)
Backed out changeset 010dfd821cf3 (bug 1696894)
Backed out changeset 96a39c2ba7a3 (bug 1754004)
Backed out changeset a147df47a0e3 (bug 1754004)
Backed out changeset 9018dd592230 (bug 1754004)
Backed out changeset 234ff9e092c2 (bug 1754004)
Backed out changeset c4f1e86992b6 (bug 1754004)
Backed out changeset 51bd50b57dd5 (bug 1754004)
Backed out changeset d95e7ad0eafa (bug 1754004)
Backed out changeset 35a69828091c (bug 1754004)
Backed out changeset 6802a4326963 (bug 1754004)
Backed out changeset e40e810e18fc (bug 1754004)
Backed out changeset 82b38c12b298 (bug 1754004)
Backed out changeset 0a6cf0817bf5 (bug 1754004)
Backed out changeset 6d8e51b3e8d7 (bug 1754004)
Backed out changeset 2059c2d0d880 (bug 1754004)
2022-05-05 11:27:42 +02:00
Nika Layzell
310e31989e Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,necko-reviewers,kershaw
This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
2022-05-03 23:30:32 +00:00