summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_attachment_set.cc
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-07-27 11:26:14 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-27 18:27:24 +0000
commitde9412b8832db0c6e1e283e9f8fce53eb4fd4e67 (patch)
treec11c10692706b48638f5f109d59594edc1cdfd3b /ipc/ipc_message_attachment_set.cc
parent67081d0ae8833a0f36203f2437b0abdcc4c5e197 (diff)
downloadchromium_src-de9412b8832db0c6e1e283e9f8fce53eb4fd4e67.zip
chromium_src-de9412b8832db0c6e1e283e9f8fce53eb4fd4e67.tar.gz
chromium_src-de9412b8832db0c6e1e283e9f8fce53eb4fd4e67.tar.bz2
Update ChannelReader to use AttachmentBroker.
Previously, translating from bytes into messages and dispatching the messages was accomplished in a single step. I've split this into two steps. The function TranslateInputData turns bytes into messages, and puts those messages in a queue. The function DispatchMessages() dispatches messages from the queue. Messages cannot be dispatched until all attachments have been brokered, so DispatchMessages() will sometimes wait (asynchronously) for the attachments to get brokered. BUG=466437 Review URL: https://codereview.chromium.org/1206093002 Cr-Commit-Position: refs/heads/master@{#340509}
Diffstat (limited to 'ipc/ipc_message_attachment_set.cc')
-rw-r--r--ipc/ipc_message_attachment_set.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/ipc/ipc_message_attachment_set.cc b/ipc/ipc_message_attachment_set.cc
index ed653f3..1a4969f 100644
--- a/ipc/ipc_message_attachment_set.cc
+++ b/ipc/ipc_message_attachment_set.cc
@@ -143,6 +143,19 @@ MessageAttachmentSet::PeekBrokerableAttachments() const {
return output;
}
+std::vector<scoped_refptr<BrokerableAttachment>>
+MessageAttachmentSet::GetBrokerableAttachmentsForUpdating() {
+ std::vector<scoped_refptr<BrokerableAttachment>> output;
+ for (const scoped_refptr<MessageAttachment>& attachment : attachments_) {
+ if (attachment->GetType() ==
+ MessageAttachment::TYPE_BROKERABLE_ATTACHMENT) {
+ output.push_back(scoped_refptr<BrokerableAttachment>(
+ static_cast<BrokerableAttachment*>(attachment.get())));
+ }
+ }
+ return output;
+}
+
#if defined(OS_POSIX)
void MessageAttachmentSet::PeekDescriptors(base::PlatformFile* buffer) const {