Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: base/sync_socket_posix.cc

Issue 1997153002: libchrome: Several upstreamable fixes from libchrome Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Addressed feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(ProcessHandle /*peer_process_handle*/,
109 TransitDescriptor* descriptor) { 109 TransitDescriptor* descriptor) {
110 descriptor->fd = handle(); 110 descriptor->fd = handle();
111 descriptor->auto_close = false; 111 descriptor->auto_close = false;
112 return descriptor->fd != kInvalidHandle; 112 return descriptor->fd != kInvalidHandle;
113 } 113 }
114 114
115 bool SyncSocket::Close() { 115 bool SyncSocket::Close() {
116 const bool retval = CloseHandle(handle_); 116 const bool retval = CloseHandle(handle_);
117 handle_ = kInvalidHandle; 117 handle_ = kInvalidHandle;
118 return retval; 118 return retval;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return len; 239 return len;
240 } 240 }
241 241
242 // static 242 // static
243 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, 243 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
244 CancelableSyncSocket* socket_b) { 244 CancelableSyncSocket* socket_b) {
245 return SyncSocket::CreatePair(socket_a, socket_b); 245 return SyncSocket::CreatePair(socket_a, socket_b);
246 } 246 }
247 247
248 } // namespace base 248 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698