diff options
Diffstat (limited to 'ipc/ipc_message.h')
-rw-r--r-- | ipc/ipc_message.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h index 09d335c..2d677aa 100644 --- a/ipc/ipc_message.h +++ b/ipc/ipc_message.h @@ -8,7 +8,8 @@ #include <string> #include "base/basictypes.h" -#include "base/files/file.h" +#include "base/debug/trace_event.h" +#include "base/memory/ref_counted.h" #include "base/pickle.h" #include "base/trace_event/trace_event.h" #include "ipc/ipc_export.h" @@ -17,15 +18,12 @@ #define IPC_MESSAGE_LOG_ENABLED #endif -#if defined(OS_POSIX) -#include "base/memory/ref_counted.h" -#endif - namespace IPC { //------------------------------------------------------------------------------ struct LogData; +class MessageAttachment; class MessageAttachmentSet; class IPC_EXPORT Message : public Pickle { @@ -169,21 +167,15 @@ class IPC_EXPORT Message : public Pickle { return Pickle::FindNext(sizeof(Header), range_start, range_end); } -#if defined(OS_POSIX) - // 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 if the set is full. - bool WriteFile(base::ScopedFD descriptor); - bool WriteBorrowingFile(const base::PlatformFile& descriptor); - - // Get a file descriptor from the message. Returns false on error. - // iter: a Pickle iterator to the current location in the message. - bool ReadFile(PickleIterator* iter, base::ScopedFD* file) const; - - // Returns true if there are any file descriptors in this message. - bool HasFileDescriptors() const; -#endif + // WriteAttachment appends |attachment| to the end of the set. It returns + // false iff the set is full. + bool WriteAttachment(scoped_refptr<MessageAttachment> attachment); + // ReadAttachment parses an attachment given the parsing state |iter| and + // writes it to |*attachment|. It returns true on success. + bool ReadAttachment(PickleIterator* iter, + scoped_refptr<MessageAttachment>* attachment) const; + // Returns true if there are any attachment in this message. + bool HasAttachments() const; #ifdef IPC_MESSAGE_LOG_ENABLED // Adds the outgoing time from Time::Now() at the end of the message and sets |