Closed Bug 1713148 Opened 3 years ago Closed 3 years ago

Use the message router for all channels

Categories

(Core :: IPC, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(6 files)

Build on top of the work in bug 1706374 to also use these multiplexed channels for other channels between processes such as PBackground.

This is used because, unlike in Mojo, we cannot get from the IPC::Message
object to its enclosing UserMessageEvent object to attach more ports to it, and
this extra parameter makes that easy to do.

These port attachments are stored directly on the IPC::Message until the
message is ready to be routed to another process, at which point they will be
attached to the port in WillBeRoutedExternally. When the message is then
received on the other side, the ports will be re-extracted from the
UserMessageEvent before it is discarded and re-added to the IPC::Message so
that serializers only need to interact directly with the IPC::Message type.

This adjusts how all actors created using Endpoint behave so that they now
use ports instead of creating a unique native channel connection between each
pair of processes.

After the changes in part 3, this type is now dead code and can be fully
removed.

This removes the last form of unique link between two MessageChannels so that
all MessageChannels communicate using PortLink, as it is fairly straightforward
to use PortLink to communicate between two threads in-process.

Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/677e1ee99bb2
Part 1: Expose UserMessageEvent to WillBeRoutedExternally, r=handyman
https://hg.mozilla.org/integration/autoland/rev/2da57973ed55
Part 2: Support port attachments on IPC messages, r=handyman
https://hg.mozilla.org/integration/autoland/rev/f2e5309c914c
Part 3: Use ports for Endpoint-created actors, r=handyman
https://hg.mozilla.org/integration/autoland/rev/fd8523d5126e
Part 4: Remove ProcessLink, r=handyman
https://hg.mozilla.org/integration/autoland/rev/ea469eaa54ca
Part 5: Remove ThreadLink, r=handyman
See Also: → 1717547
Flags: needinfo?(nika)
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/40133c11821d
Part 1: Expose UserMessageEvent to WillBeRoutedExternally, r=handyman
https://hg.mozilla.org/integration/autoland/rev/04abcc40b9ff
Part 2: Support port attachments on IPC messages, r=handyman
https://hg.mozilla.org/integration/autoland/rev/2a526c6c4d9d
Part 3: Use ports for Endpoint-created actors, r=handyman
https://hg.mozilla.org/integration/autoland/rev/c07634493a6f
Part 4: Remove ProcessLink, r=handyman
https://hg.mozilla.org/integration/autoland/rev/b67473c8e44e
Part 5: Remove ThreadLink, r=handyman
https://hg.mozilla.org/integration/autoland/rev/ad6887dc2abf
Part 6: Release sChannelCountMutex before calling report callback, r=handyman
Regressions: 1717728
Blocks: 1652463
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: