Closed Bug 1734735 Opened 3 years ago Closed 2 years ago

Relay mach port send rights via the broker process

Categories

(Core :: IPC, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(8 files)

Much like bug 1732343, this patch tracks using the same infrastructure to transfer mach ports using the broker process. This will be handled in a similar way to how Mojo handled mach ports before they converted to using mach as the primary IPC mechanism on macOS (https://source.chromium.org/chromium/chromium/src/+/9f707e5e04598d8303fa99ca29eb507c839767d8:mojo/core/mach_port_relay.cc, https://source.chromium.org/chromium/chromium/src/+/9f707e5e04598d8303fa99ca29eb507c839767d8:base/mac/mach_port_util.cc).

With this change and the changes in bug 1732343 it will be possible to create IPC connections between processes without requiring knowledge of the OtherPid() to transfer native handles and shared memory.

This patch only handles transferring mach send rights, as they are the only handle type required for mach shared memory. If receive rights are required in the future, support can be added, or we can migrate to using mach ports for IPC directly.

Depends on: 1732343
Attachment #9245490 - Attachment description: Bug 1734735 - Part 8: Remove the now-unused old mach_ipc_mac code, r=jld → Bug 1734735 - Part 8: Remove the now-unused old mach_ipc_mac code, r=#ipc-reviewers
Attachment #9245489 - Attachment description: Bug 1734735 - Part 7: Remove all SharedMemoryBasic special messaging code, r=jld → Bug 1734735 - Part 7: Remove all SharedMemoryBasic special messaging code, r=#ipc-reviewers
Attachment #9245489 - Attachment description: Bug 1734735 - Part 7: Remove all SharedMemoryBasic special messaging code, r=#ipc-reviewers → Bug 1734735 - Part 7: Remove all SharedMemoryBasic special messaging code, r=jld
Attachment #9245490 - Attachment description: Bug 1734735 - Part 8: Remove the now-unused old mach_ipc_mac code, r=#ipc-reviewers → Bug 1734735 - Part 8: Remove the now-unused old mach_ipc_mac code, r=jld
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/596b8bffe529
Part 1: Add UniqueMach{Send,Recv}Right types, r=glandium
https://hg.mozilla.org/integration/autoland/rev/aebe310d90ce
Part 2: Support getter_Transfers with non-pointer UniquePtr types, r=glandium
https://hg.mozilla.org/integration/autoland/rev/88b9087be476
Part 3: Generalize IPC message footer writing code, r=handyman
https://hg.mozilla.org/integration/autoland/rev/610ad8dcfea2
Part 4: Support relaying mach ports via the parent process, r=handyman,mstange
https://hg.mozilla.org/integration/autoland/rev/612077241842
Part 5: Convert SharedMemoryBasic_mach to use relayed mach ports, r=handyman
https://hg.mozilla.org/integration/autoland/rev/d9872022b7f5
Part 6: Remove dead TextureSync code, r=dthayer
https://hg.mozilla.org/integration/autoland/rev/0204dcc02d93
Part 7: Remove all SharedMemoryBasic special messaging code, r=handyman
https://hg.mozilla.org/integration/autoland/rev/6c377347f58b
Part 8: Remove the now-unused old mach_ipc_mac code, r=handyman
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: