summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-29 00:05:04 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-29 00:05:04 +0000
commit34d4861069f6528aac208a3268f8c4946d301a16 (patch)
tree0efd4735b9912a93b220f9e312d7ca14cf281360 /ipc/ipc_message.cc
parentb9ef2965a07ca50fd94f1ab1d22ffcfdf62a2b6d (diff)
downloadchromium_src-34d4861069f6528aac208a3268f8c4946d301a16.zip
chromium_src-34d4861069f6528aac208a3268f8c4946d301a16.tar.gz
chromium_src-34d4861069f6528aac208a3268f8c4946d301a16.tar.bz2
Make the serialization of IPC::Messages inside other IPC::Messages independent
of the platform. This is necessary for sending nested messages between nacl (which the IPC system thinks is posix and so has extra header goo) and a Windows client app (which doesn't have this stuff). BUG= Review URL: https://chromiumcodereview.appspot.com/10667002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144840 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message.cc')
-rw-r--r--ipc/ipc_message.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc
index feec91a..9908bc7 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;