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

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: Fix timeout and naming. 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 return -1;
jar (doing other things) 2013/10/14 15:31:07 Shouldn't this be return 0?
DaleCurtis 2013/10/14 19:25:13 I just copied the pattern, but probably all of the
50 }
51
48 size_t SyncSocket::Peek() { 52 size_t SyncSocket::Peek() {
49 return -1; 53 return -1;
50 } 54 }
51 55
52 CancelableSyncSocket::CancelableSyncSocket() { 56 CancelableSyncSocket::CancelableSyncSocket() {
53 } 57 }
54 58
55 CancelableSyncSocket::CancelableSyncSocket(Handle handle) 59 CancelableSyncSocket::CancelableSyncSocket(Handle handle)
56 : SyncSocket(handle) { 60 : SyncSocket(handle) {
57 } 61 }
58 62
59 size_t CancelableSyncSocket::Send(const void* buffer, size_t length) { 63 size_t CancelableSyncSocket::Send(const void* buffer, size_t length) {
60 return -1; 64 return -1;
61 } 65 }
62 66
63 bool CancelableSyncSocket::Shutdown() { 67 bool CancelableSyncSocket::Shutdown() {
64 return false; 68 return false;
65 } 69 }
66 70
67 // static 71 // static
68 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, 72 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
69 CancelableSyncSocket* socket_b) { 73 CancelableSyncSocket* socket_b) {
70 return SyncSocket::CreatePair(socket_a, socket_b); 74 return SyncSocket::CreatePair(socket_a, socket_b);
71 } 75 }
72 76
73 } // namespace base 77 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698