diff options
author | morrita <morrita@chromium.org> | 2014-09-24 13:11:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-24 20:11:59 +0000 |
commit | 96693856edc35a538f6ea8f0bd6ab55c75e3e823 (patch) | |
tree | 33bf28816211d8c3a5039db1d2f3a1ac74adf59e /ipc/ipc_message.h | |
parent | 33169d9f2497a79fdde3ae51c5aa7266032526c7 (diff) | |
download | chromium_src-96693856edc35a538f6ea8f0bd6ab55c75e3e823.zip chromium_src-96693856edc35a538f6ea8f0bd6ab55c75e3e823.tar.gz chromium_src-96693856edc35a538f6ea8f0bd6ab55c75e3e823.tar.bz2 |
IPC: Get rid of FileDescriptor usage from FileDescriptorSet and Message
This is a step toward to killing FileDescriptor.
This change lets FiileDescriptorSet have both Files (for owning fds)
and PlatformFiles (for non-owning fds). Doing this, we no longer
need FileDescriptor which provides |auto_close| flag.
BUG=415294
TEST=ipc_tests, ipc_mojo_unittests
R=agl@chromium.org, jam@hcromium.org, viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/583473002
Cr-Commit-Position: refs/heads/master@{#296498}
Diffstat (limited to 'ipc/ipc_message.h')
-rw-r--r-- | ipc/ipc_message.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h index 198e6c0..a48fcb1 100644 --- a/ipc/ipc_message.h +++ b/ipc/ipc_message.h @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/debug/trace_event.h" +#include "base/files/file.h" #include "base/pickle.h" #include "ipc/ipc_export.h" @@ -20,10 +21,6 @@ #include "base/memory/ref_counted.h" #endif -namespace base { -struct FileDescriptor; -} - class FileDescriptorSet; namespace IPC { @@ -178,12 +175,12 @@ class IPC_EXPORT Message : public Pickle { // 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 WriteFileDescriptor(const base::FileDescriptor& descriptor); + 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 ReadFileDescriptor(PickleIterator* iter, - base::FileDescriptor* descriptor) const; + bool ReadFile(PickleIterator* iter, base::ScopedFD* file) const; // Returns true if there are any file descriptors in this message. bool HasFileDescriptors() const; |