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

Unified Diff: ipc/ipc_message.h

Issue 883093003: IPC::Message Refactoring: Move POSIX specific bits to PlatformFileAttachment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: ipc/ipc_message.h
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h
index f25e91b37e77d002a23e1ba958abdf8b91eec563..3bd72f396f2448ce422f275d1b89786f2957d245 100644
--- a/ipc/ipc_message.h
+++ b/ipc/ipc_message.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "base/debug/trace_event.h"
-#include "base/files/file.h"
+#include "base/memory/ref_counted.h"
#include "base/pickle.h"
#include "ipc/ipc_export.h"
@@ -17,15 +17,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 +166,11 @@ 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
+ bool WriteAttachment(scoped_refptr<MessageAttachment> attachment);
agl 2015/01/30 19:34:02 comments for these? // WriteAttachment appends |a
Hajime Morrita 2015/01/30 21:01:29 Thank you for the suggestion! Adopted.
+ bool ReadAttachment(PickleIterator* iter,
agl 2015/01/30 19:34:02 // ReadAttachment parses an attachment given the p
Hajime Morrita 2015/01/30 21:01:29 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698