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

Side by Side Diff: base/sync_socket_nacl.cc

Issue 23875019: Add SyncSocket::ReceiveWithTimeout() and SyncSocket unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only AssertIOAllowed() on blocking Send(). Created 7 years, 2 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 | Annotate | Revision Log
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 <limits.h> 8 #include <limits.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 27 matching lines...) Expand all
38 38
39 size_t SyncSocket::Send(const void* buffer, size_t length) { 39 size_t SyncSocket::Send(const void* buffer, size_t length) {
40 // Not implemented since it's not needed by any client code yet. 40 // Not implemented since it's not needed by any client code yet.
41 return -1; 41 return -1;
42 } 42 }
43 43
44 size_t SyncSocket::Receive(void* buffer, size_t length) { 44 size_t SyncSocket::Receive(void* buffer, size_t length) {
45 return read(handle_, buffer, length); 45 return read(handle_, buffer, length);
46 } 46 }
47 47
48 size_t SyncSocket::ReceiveWithTimeout(void* buffer, size_t length, TimeDelta) {
49 NOTIMPLEMENTED();
50 return 0;
51 }
52
48 size_t SyncSocket::Peek() { 53 size_t SyncSocket::Peek() {
49 return -1; 54 return -1;
50 } 55 }
51 56
52 CancelableSyncSocket::CancelableSyncSocket() { 57 CancelableSyncSocket::CancelableSyncSocket() {
53 } 58 }
54 59
55 CancelableSyncSocket::CancelableSyncSocket(Handle handle) 60 CancelableSyncSocket::CancelableSyncSocket(Handle handle)
56 : SyncSocket(handle) { 61 : SyncSocket(handle) {
57 } 62 }
58 63
59 size_t CancelableSyncSocket::Send(const void* buffer, size_t length) { 64 size_t CancelableSyncSocket::Send(const void* buffer, size_t length) {
60 return -1; 65 return -1;
61 } 66 }
62 67
63 bool CancelableSyncSocket::Shutdown() { 68 bool CancelableSyncSocket::Shutdown() {
64 return false; 69 return false;
65 } 70 }
66 71
67 // static 72 // static
68 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, 73 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
69 CancelableSyncSocket* socket_b) { 74 CancelableSyncSocket* socket_b) {
70 return SyncSocket::CreatePair(socket_a, socket_b); 75 return SyncSocket::CreatePair(socket_a, socket_b);
71 } 76 }
72 77
73 } // namespace base 78 } // namespace base
OLDNEW
« no previous file with comments | « base/sync_socket.h ('k') | base/sync_socket_posix.cc » ('j') | base/sync_socket_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698