summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message.cc
diff options
context:
space:
mode:
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;