summaryrefslogtreecommitdiffstats
path: root/ipc/brokerable_attachment.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/brokerable_attachment.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/brokerable_attachment.cc')
-rw-r--r--ipc/brokerable_attachment.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/ipc/brokerable_attachment.cc b/ipc/brokerable_attachment.cc
index 764f2b2..9af40d9 100644
--- a/ipc/brokerable_attachment.cc
+++ b/ipc/brokerable_attachment.cc
@@ -21,10 +21,13 @@ BrokerableAttachment::AttachmentId GetRandomId() {
} // namespace
-BrokerableAttachment::BrokerableAttachment() : id_(GetRandomId()) {
+BrokerableAttachment::BrokerableAttachment()
+ : id_(GetRandomId()), needs_brokering_(false) {
}
-BrokerableAttachment::BrokerableAttachment(const AttachmentId& id) : id_(id) {
+BrokerableAttachment::BrokerableAttachment(const AttachmentId& id,
+ bool needs_brokering)
+ : id_(id), needs_brokering_(needs_brokering) {
}
BrokerableAttachment::~BrokerableAttachment() {
@@ -34,6 +37,14 @@ BrokerableAttachment::AttachmentId BrokerableAttachment::GetIdentifier() const {
return id_;
}
+bool BrokerableAttachment::NeedsBrokering() const {
+ return needs_brokering_;
+}
+
+void BrokerableAttachment::SetNeedsBrokering(bool needs_brokering) {
+ needs_brokering_ = needs_brokering;
+}
+
BrokerableAttachment::Type BrokerableAttachment::GetType() const {
return TYPE_BROKERABLE_ATTACHMENT;
}