Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: ipc/ipc_channel.cc

Issue 1286253002: IPC: Add attachment brokering support to the message header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile error. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel.cc
diff --git a/ipc/ipc_channel.cc b/ipc/ipc_channel.cc
index ac09c5ab1ef1d00b31c4f3a2e7b0a260673dbfbe..89505cb5f76e40ebae0075197c95b3199a0f7fbf 100644
--- a/ipc/ipc_channel.cc
+++ b/ipc/ipc_channel.cc
@@ -41,4 +41,26 @@ std::string Channel::GenerateUniqueRandomChannelID() {
base::RandInt(0, std::numeric_limits<int32>::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_);
+}
+
+size_t Channel::OutputElement::size() const {
+ if (message_)
+ return message_->size();
+ return length_;
+}
+
+const void* Channel::OutputElement::data() const {
+ if (message_)
+ return message_->data();
+ return buffer_;
+}
+
} // namespace IPC
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698