summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-10-09 19:43:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-10 02:44:28 +0000
commitae6d321b87c301100b93184daece155a91a2691a (patch)
tree704faff4d365ec03c5345c78238e01c0cd0f2e94 /ppapi
parent952bc2a2d557c5e5703a88ce8919127ae6b5c493 (diff)
downloadchromium_src-ae6d321b87c301100b93184daece155a91a2691a.zip
chromium_src-ae6d321b87c301100b93184daece155a91a2691a.tar.gz
chromium_src-ae6d321b87c301100b93184daece155a91a2691a.tar.bz2
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}
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/nacl_message_scanner.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/ppapi/proxy/nacl_message_scanner.cc b/ppapi/proxy/nacl_message_scanner.cc
index 3e522f4..769a03f 100644
--- a/ppapi/proxy/nacl_message_scanner.cc
+++ b/ppapi/proxy/nacl_message_scanner.cc
@@ -57,6 +57,7 @@ void WriteHandle(int handle_index,
// Now write the handle itself in POSIX style.
// See ParamTraits<FileDescriptor>::Read for where these values are read.
msg->WriteBool(true); // valid == true
+ msg->WriteBool(false); // brokerable == false
msg->WriteInt(handle_index);
}
}