summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel.cc
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-09-10 14:00:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-10 21:00:58 +0000
commit5142dc761154a396901c5f6f1e41c5bad3664ec8 (patch)
tree2740c22fef8a676bac5b3dc1279c543650005aa8 /ipc/ipc_channel.cc
parent6bbbabdc22f08204b46d7d2c010a0ff1acd59972 (diff)
downloadchromium_src-5142dc761154a396901c5f6f1e41c5bad3664ec8.zip
chromium_src-5142dc761154a396901c5f6f1e41c5bad3664ec8.tar.gz
chromium_src-5142dc761154a396901c5f6f1e41c5bad3664ec8.tar.bz2
ipc: Add the inner class OutputElement to Channel.
OutputElement is a wrapper around messages that are going to be written to the underlying OS IPC mechanism. It can wrap either a Message, or a data buffer which contains serialized attachment broker metainformation. BUG=493414 Review URL: https://codereview.chromium.org/1309003003 Cr-Commit-Position: refs/heads/master@{#348229}
Diffstat (limited to 'ipc/ipc_channel.cc')
-rw-r--r--ipc/ipc_channel.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/ipc/ipc_channel.cc b/ipc/ipc_channel.cc
index e659205..6772e1c 100644
--- a/ipc/ipc_channel.cc
+++ b/ipc/ipc_channel.cc
@@ -43,4 +43,14 @@ std::string Channel::GenerateUniqueRandomChannelID() {
base::RandInt(0, std::numeric_limits<int32_t>::max()));
}
+Channel::OutputElement::OutputElement(Message* message)
+ : message_(message), buffer_(nullptr), length_(0) {}
+
+Channel::OutputElement::OutputElement(void* buffer, size_t length)
+ : message_(nullptr), buffer_(buffer), length_(length) {}
+
+Channel::OutputElement::~OutputElement() {
+ free(buffer_);
+}
+
} // namespace IPC