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

Unified Diff: ipc/ipc_message.h

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.gyp ('k') | ipc/ipc_message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message.h
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h
index c3d4296cfe3e3adda857d30ad80d6e201dcc9996..85cacf084197a3cdd9f6dc47210a0e13c042896a 100644
--- a/ipc/ipc_message.h
+++ b/ipc/ipc_message.h
@@ -149,6 +149,15 @@ class IPC_EXPORT Message : public Pickle {
return header()->flags;
}
+ void set_flags(uint32 f) {
+ header()->flags = f;
+ }
+
+ // This is used when deserializing nested messages. It sets the given header
darin (slow to review) 2012/06/22 21:42:16 nit: people often fail to update comments like thi
+ // values. The message should be empty.
+ void SetHeaderValues(int32 routing, uint32 type, uint32 flags);
+
+
template<class T, class S>
static bool Dispatch(const Message* msg, T* obj, S* sender,
void (T::*func)()) {
@@ -191,12 +200,16 @@ class IPC_EXPORT Message : public Pickle {
// On POSIX, a message supports reading / writing FileDescriptor objects.
// This is used to pass a file descriptor to the peer of an IPC channel.
- // Add a descriptor to the end of the set. Returns false iff the set is full.
+ // Add a descriptor to the end of the set. Returns false if the set is full.
bool WriteFileDescriptor(const base::FileDescriptor& descriptor);
+
// Get a file descriptor from the message. Returns false on error.
// iter: a Pickle iterator to the current location in the message.
bool ReadFileDescriptor(PickleIterator* iter,
base::FileDescriptor* descriptor) const;
+
+ // Returns true if there are any file descriptors in this message.
+ bool HasFileDescriptors() const;
#endif
#ifdef IPC_MESSAGE_LOG_ENABLED
« no previous file with comments | « ipc/ipc.gyp ('k') | ipc/ipc_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698