Chromium Code Reviews| Index: base/sync_socket_win.cc |
| diff --git a/base/sync_socket_win.cc b/base/sync_socket_win.cc |
| index 26e76ec2738e6629fbf4b0c41cc61ac0b7e7d6ec..3c40ebaa6f1a9a8a296909153aeabdabb384f569 100644 |
| --- a/base/sync_socket_win.cc |
| +++ b/base/sync_socket_win.cc |
| @@ -207,6 +207,23 @@ bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) { |
| return CreatePairImpl(&socket_a->handle_, &socket_b->handle_, false); |
| } |
| +// static |
| +SyncSocket::Handle SyncSocket::UnwrapHandle( |
| + const TransitDescriptor& descriptor) { |
| + return descriptor; |
| +} |
| + |
| +bool SyncSocket::PrepareTransitDescriptor(ProcessHandle peer_process_handle, |
| + TransitDescriptor* descriptor) { |
| + DCHECK(descriptor); |
|
tommi (sloooow) - chröme
2014/09/04 19:47:00
this dcheck on the other hand is useful
burnik
2014/09/05 08:17:42
Acknowledged.
|
| + if (!::DuplicateHandle(GetCurrentProcess(), handle(), peer_process_handle, |
| + descriptor, 0, FALSE, DUPLICATE_SAME_ACCESS)) { |
| + DPLOG(ERROR) << "Cannot duplicate socket handle for peer process."; |
| + return false; |
| + } |
| + return true; |
| +} |
| + |
| bool SyncSocket::Close() { |
| if (handle_ == kInvalidHandle) |
| return true; |