Index: base/sync_socket.h |
diff --git a/base/sync_socket.h b/base/sync_socket.h |
index 71addd1e163a9ab16d201a961ba3ae5b3ed6972f..992359166e51929ba8ec5a113becc38259d560d4 100644 |
--- a/base/sync_socket.h |
+++ b/base/sync_socket.h |
@@ -17,17 +17,24 @@ |
#include "base/base_export.h" |
#include "base/compiler_specific.h" |
+#include "base/process/process_handle.h" |
#include "base/synchronization/waitable_event.h" |
#include "base/time/time.h" |
+#if defined(OS_POSIX) |
+#include "base/file_descriptor_posix.h" |
+#endif |
+ |
namespace base { |
class BASE_EXPORT SyncSocket { |
public: |
#if defined(OS_WIN) |
typedef HANDLE Handle; |
+ typedef Handle TransitDescriptor; |
#else |
typedef int Handle; |
+ typedef FileDescriptor TransitDescriptor; |
#endif |
static const Handle kInvalidHandle; |
@@ -42,6 +49,15 @@ class BASE_EXPORT SyncSocket { |
// return, the sockets will both be valid and connected. |
static bool CreatePair(SyncSocket* socket_a, SyncSocket* socket_b); |
+ // Returns |Handle| wrapped in a |TransitDescriptor|. |
+ static Handle UnwrapHandle(const TransitDescriptor& descriptor); |
+ |
+ // Prepares a |TransitDescriptor| which wraps |Handle| used for transit. |
+ // This is used to prepare the underlying shared resource before passing back |
+ // the handle to be used by the peer process. |
+ bool PrepareTransitDescriptor(ProcessHandle peer_process_handle, |
+ TransitDescriptor* descriptor); |
+ |
// Closes the SyncSocket. Returns true on success, false on failure. |
virtual bool Close(); |