Update EDK IPC API
This continues the replacement of the inaccurate EDK API model of
"parent" and "child" process relationships with something that more
accurately reflects the behavior of the system. This terminology
change only affects the public API for now, so the underlying
protocol details remain poorly named.
Rather than implying that a process may only be introduced into the
process graph by its parent, and rather than giving the developer a
series of public, stateless API functions to set up interprocess
connections, this CL introduces the concept of an "invitation" to join a
group of interconnected Mojo embedders.
If a process is acting as the broker, or is itself already a broker
client, it may send an OutgoingBrokerClientInvitation over some OS IPC
resource (e.g. an OS pipe). The target process can then construct an
IncomingBrokerClientInvitation from some corresponding OS IPC resource
(e.g. the other end of that pipe) which has been shared with it
out-of-band. This object can be used to accept the invitation and thus
join the process graph as a new broker client.
Cross-process bootstrap message pipes may be "attached" to an invitation
by the sender and "extracted" by the accepting process.
Note that in order to facilitate the new pipe attachment API which
encourages user-selected message pipe names (rather than much less
convenient unguessable nonces that require more out-of-band
communication), port reservations made on behalf of outgoing invitations
are now strictly scoped to the invitation target, allowing names to be
reused for different invitations and avoiding any risk of a misbehaving
process claiming someone else's port.
The vast majority of changes outside //mojo here are strictly aesthetic
adaptations to the new API and do not constitute any kind of behavioral
change.
Follow-up CLs will replace usage of SetParentPipeHandle* and
CreateChildMessagePipe with IncomingBrokerClientInvitation API usage,
and eliminate the peer-connection-related functions with a
new stateful PeerConnection object; thus completing the public API
changes necessary to support the transition to a more flexible
transport protocol selection.
BUG=696031
Change-Id: I4b9a8f76fc8457b31a3dc1390ecec3fc0235b732
Reviewed-on: https://chromium-review.googlesource.com/498972
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#470863}
CrOS-Libchrome-Original-Commit: ea1716a00c9d7ba48f98537099a1ccd750bdaa37
18 files changed