ipc: Make a separate vector for brokerable attachments.
On Mac, an IPC::Message can have both non-brokered and brokered attachments.
During Message serialization, an index of the attachment is written as a
placeholder for the attachment. This relies on the assumption that there exists
a well defined ordering for all attachments. The receiving processes multiplexes
brokered and non-brokered attachments across different communication mediums,
and the ordering between them is non-deterministic.
I changed MessageAttachmentSet to have two vectors - one for brokered
attachments and one for non-brokered attachments. During Message serialization,
a bool is written that indicates whether the attachment is brokered, and then an
index into the appropriate vector.
I decided not to add an equivalent of |consumed_descriptor_highwater_| for
brokered attachments for two reasons:
1) The sender has clearer ownership semantics for brokered attachments, and
they will clean themselves up appropriately without assistance from the
MessageAttachmentSet.
2) Ownership semantics are fundamentally broken in the receiver, since the
semantics for Message translation are stateless, whereas ownership transfer is
stateful. Note the presence of awkward hacks for
|consumed_descriptor_highwater_|, for which there is no good solution.
BUG=535711
Review URL: https://codereview.chromium.org/1401473002
Cr-Commit-Position: refs/heads/master@{#353457}
9 files changed