Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/sync_socket.h" | 5 #include "base/sync_socket.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <limits.h> | 8 #include <limits.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 | 15 |
| 16 const SyncSocket::Handle SyncSocket::kInvalidHandle = -1; | 16 const SyncSocket::Handle SyncSocket::kInvalidHandle = -1; |
| 17 | 17 |
| 18 SyncSocket::SyncSocket() : handle_(kInvalidHandle) { | 18 SyncSocket::SyncSocket() : handle_(kInvalidHandle) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 SyncSocket::~SyncSocket() { | 21 SyncSocket::~SyncSocket() { |
| 22 Close(); | 22 Close(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 // static | 25 // static |
| 26 bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) { | 26 bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) { |
| 27 return false; | 27 return false; |
| 28 } | 28 } |
| 29 | 29 |
| 30 // static | |
| 31 SyncSocket::Handle SyncSocket::UnwrapHandle( | |
| 32 const SyncSocket::TransitDescriptor& descriptor) { | |
| 33 NOTIMPLEMENTED(); | |
|
henrika (OOO until Aug 14)
2014/09/01 14:30:43
Add TODO and link to issue in crbug.
burnik
2014/09/01 14:59:33
Done.
| |
| 34 return SyncSocket::kInvalidHandle; | |
| 35 } | |
| 36 | |
| 37 bool SyncSocket::PrepareTransitDescriptor(ProcessHandle peer_process_handle, | |
| 38 SyncSocket::TransitDescriptor * descriptor) { | |
|
no longer working on chromium
2014/09/01 14:56:18
indentation. run git-clang-format
burnik
2014/09/01 15:08:02
Done.
| |
| 39 NOTIMPLEMENTED(); | |
|
henrika (OOO until Aug 14)
2014/09/01 14:30:43
Same here.
burnik
2014/09/01 14:59:33
Done.
| |
| 40 return false; | |
| 41 } | |
| 42 | |
| 30 bool SyncSocket::Close() { | 43 bool SyncSocket::Close() { |
| 31 if (handle_ != kInvalidHandle) { | 44 if (handle_ != kInvalidHandle) { |
| 32 if (close(handle_) < 0) | 45 if (close(handle_) < 0) |
| 33 DPLOG(ERROR) << "close"; | 46 DPLOG(ERROR) << "close"; |
| 34 handle_ = kInvalidHandle; | 47 handle_ = kInvalidHandle; |
| 35 } | 48 } |
| 36 return true; | 49 return true; |
| 37 } | 50 } |
| 38 | 51 |
| 39 size_t SyncSocket::Send(const void* buffer, size_t length) { | 52 size_t SyncSocket::Send(const void* buffer, size_t length) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 return SyncSocket::Close(); | 84 return SyncSocket::Close(); |
| 72 } | 85 } |
| 73 | 86 |
| 74 // static | 87 // static |
| 75 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, | 88 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, |
| 76 CancelableSyncSocket* socket_b) { | 89 CancelableSyncSocket* socket_b) { |
| 77 return SyncSocket::CreatePair(socket_a, socket_b); | 90 return SyncSocket::CreatePair(socket_a, socket_b); |
| 78 } | 91 } |
| 79 | 92 |
| 80 } // namespace base | 93 } // namespace base |
| OLD | NEW |