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

Side by Side Diff: base/sync_socket_posix.cc

Issue 2814443007: EXPERIMENTAL (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_renderer_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 DCHECK_LE(length, kMaxMessageLength); 38 DCHECK_LE(length, kMaxMessageLength);
39 DCHECK_NE(handle, SyncSocket::kInvalidHandle); 39 DCHECK_NE(handle, SyncSocket::kInvalidHandle);
40 const char* charbuffer = static_cast<const char*>(buffer); 40 const char* charbuffer = static_cast<const char*>(buffer);
41 return WriteFileDescriptor(handle, charbuffer, length) 41 return WriteFileDescriptor(handle, charbuffer, length)
42 ? static_cast<size_t>(length) 42 ? static_cast<size_t>(length)
43 : 0; 43 : 0;
44 } 44 }
45 45
46 bool CloseHandle(SyncSocket::Handle handle) { 46 bool CloseHandle(SyncSocket::Handle handle) {
47 if (handle != SyncSocket::kInvalidHandle && close(handle) < 0) { 47 if (handle != SyncSocket::kInvalidHandle && close(handle) < 0) {
48 CHECK(errno != EBADF) << "Probable double-close of socket handle.";
48 DPLOG(ERROR) << "close"; 49 DPLOG(ERROR) << "close";
49 return false; 50 return false;
50 } 51 }
51 52
52 return true; 53 return true;
53 } 54 }
54 55
55 } // namespace 56 } // namespace
56 57
57 const SyncSocket::Handle SyncSocket::kInvalidHandle = -1; 58 const SyncSocket::Handle SyncSocket::kInvalidHandle = -1;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 return len; 246 return len;
246 } 247 }
247 248
248 // static 249 // static
249 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, 250 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
250 CancelableSyncSocket* socket_b) { 251 CancelableSyncSocket* socket_b) {
251 return SyncSocket::CreatePair(socket_a, socket_b); 252 return SyncSocket::CreatePair(socket_a, socket_b);
252 } 253 }
253 254
254 } // namespace base 255 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_renderer_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698