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

Unified Diff: ipc/ipc_message.cc

Issue 10667002: Make the serialization of IPC::Messages inside other IPC::Messages independent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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_message.h ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message.cc
diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc
index feec91abb7194fafb241965ba24f2e3a16cc252c..9908bc7a001bd2ce3770ec1e789d8fbb4c133b20 100644
--- a/ipc/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -67,6 +67,15 @@ Message& Message::operator=(const Message& other) {
return *this;
}
+void Message::SetHeaderValues(int32 routing, uint32 type, uint32 flags) {
+ // This should only be called when the message is already empty.
+ DCHECK(payload_size() == 0);
+
+ header()->routing = routing;
+ header()->type = type;
+ header()->flags = flags;
+}
+
#ifdef IPC_MESSAGE_LOG_ENABLED
void Message::set_sent_time(int64 time) {
DCHECK((header()->flags & HAS_SENT_TIME_BIT) == 0);
@@ -116,6 +125,10 @@ bool Message::ReadFileDescriptor(PickleIterator* iter,
return descriptor->fd >= 0;
}
+bool Message::HasFileDescriptors() const {
+ return file_descriptor_set_.get() && !file_descriptor_set_->empty();
+}
+
void Message::EnsureFileDescriptorSet() {
if (file_descriptor_set_.get() == NULL)
file_descriptor_set_ = new FileDescriptorSet;
« no previous file with comments | « ipc/ipc_message.h ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698