| 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 <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <limits.h> | 9 #include <limits.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 return true; | 99 return true; |
| 100 } | 100 } |
| 101 | 101 |
| 102 // static | 102 // static |
| 103 SyncSocket::Handle SyncSocket::UnwrapHandle( | 103 SyncSocket::Handle SyncSocket::UnwrapHandle( |
| 104 const TransitDescriptor& descriptor) { | 104 const TransitDescriptor& descriptor) { |
| 105 return descriptor.fd; | 105 return descriptor.fd; |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool SyncSocket::PrepareTransitDescriptor(ProcessHandle peer_process_handle, | 108 bool SyncSocket::PrepareTransitDescriptor( |
| 109 TransitDescriptor* descriptor) { | 109 ProcessHandle /* peer_process_handle */, |
| 110 TransitDescriptor* descriptor) { |
| 110 descriptor->fd = handle(); | 111 descriptor->fd = handle(); |
| 111 descriptor->auto_close = false; | 112 descriptor->auto_close = false; |
| 112 return descriptor->fd != kInvalidHandle; | 113 return descriptor->fd != kInvalidHandle; |
| 113 } | 114 } |
| 114 | 115 |
| 115 bool SyncSocket::Close() { | 116 bool SyncSocket::Close() { |
| 116 const bool retval = CloseHandle(handle_); | 117 const bool retval = CloseHandle(handle_); |
| 117 handle_ = kInvalidHandle; | 118 handle_ = kInvalidHandle; |
| 118 return retval; | 119 return retval; |
| 119 } | 120 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 return len; | 240 return len; |
| 240 } | 241 } |
| 241 | 242 |
| 242 // static | 243 // static |
| 243 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, | 244 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, |
| 244 CancelableSyncSocket* socket_b) { | 245 CancelableSyncSocket* socket_b) { |
| 245 return SyncSocket::CreatePair(socket_a, socket_b); | 246 return SyncSocket::CreatePair(socket_a, socket_b); |
| 246 } | 247 } |
| 247 | 248 |
| 248 } // namespace base | 249 } // namespace base |
| OLD | NEW |