Chromium Code Reviews| Index: base/sync_socket.h |
| diff --git a/base/sync_socket.h b/base/sync_socket.h |
| index 71addd1e163a9ab16d201a961ba3ae5b3ed6972f..1c3ac4fc2f20622f3fbb620ab6ea57a4f38b3fcd 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; |
|
no longer working on chromium
2014/09/01 14:56:18
The existing sync socket code is dealing with "han
burnik
2014/09/01 15:08:02
Both work good for me. Agreed. Tommi should have a
|
| #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 foreign handle to the peer process. |
|
no longer working on chromium
2014/09/01 14:56:18
s/foreign handle/transit handle/g
burnik
2014/09/01 15:08:02
If we change to |TransitHandle| then agreed.
On 20
no longer working on chromium
2014/09/02 10:25:04
There is no "foreign" concept in the code or comme
burnik
2014/09/02 15:01:34
Done.
|
| + bool PrepareTransitDescriptor(ProcessHandle peer_process_handle, |
| + TransitDescriptor * descriptor); |
|
henrika (OOO until Aug 14)
2014/09/01 14:30:43
nit, TransitDescriptor*
burnik
2014/09/01 14:59:33
Done.
|
| + |
| // Closes the SyncSocket. Returns true on success, false on failure. |
| virtual bool Close(); |