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

Side by Side Diff: net/socket/socket_test_util.h

Issue 227473008: make SetReceiveBufferSize and SetSendBufferSize return net error codes (instead of bools) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Original CL, as was submitted, and previously reverted Created 6 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 | 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 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_
6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 // unique socket IDs. 668 // unique socket IDs.
669 explicit MockClientSocket(const BoundNetLog& net_log); 669 explicit MockClientSocket(const BoundNetLog& net_log);
670 670
671 // Socket implementation. 671 // Socket implementation.
672 virtual int Read(IOBuffer* buf, 672 virtual int Read(IOBuffer* buf,
673 int buf_len, 673 int buf_len,
674 const CompletionCallback& callback) = 0; 674 const CompletionCallback& callback) = 0;
675 virtual int Write(IOBuffer* buf, 675 virtual int Write(IOBuffer* buf,
676 int buf_len, 676 int buf_len,
677 const CompletionCallback& callback) = 0; 677 const CompletionCallback& callback) = 0;
678 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; 678 virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
679 virtual bool SetSendBufferSize(int32 size) OVERRIDE; 679 virtual int SetSendBufferSize(int32 size) OVERRIDE;
680 680
681 // StreamSocket implementation. 681 // StreamSocket implementation.
682 virtual int Connect(const CompletionCallback& callback) = 0; 682 virtual int Connect(const CompletionCallback& callback) = 0;
683 virtual void Disconnect() OVERRIDE; 683 virtual void Disconnect() OVERRIDE;
684 virtual bool IsConnected() const OVERRIDE; 684 virtual bool IsConnected() const OVERRIDE;
685 virtual bool IsConnectedAndIdle() const OVERRIDE; 685 virtual bool IsConnectedAndIdle() const OVERRIDE;
686 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; 686 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
687 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; 687 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
688 virtual const BoundNetLog& NetLog() const OVERRIDE; 688 virtual const BoundNetLog& NetLog() const OVERRIDE;
689 virtual void SetSubresourceSpeculation() OVERRIDE {} 689 virtual void SetSubresourceSpeculation() OVERRIDE {}
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 virtual void CompleteWrite() OVERRIDE; 843 virtual void CompleteWrite() OVERRIDE;
844 virtual int CompleteRead() OVERRIDE; 844 virtual int CompleteRead() OVERRIDE;
845 845
846 // Socket implementation. 846 // Socket implementation.
847 virtual int Read(IOBuffer* buf, 847 virtual int Read(IOBuffer* buf,
848 int buf_len, 848 int buf_len,
849 const CompletionCallback& callback) OVERRIDE; 849 const CompletionCallback& callback) OVERRIDE;
850 virtual int Write(IOBuffer* buf, 850 virtual int Write(IOBuffer* buf,
851 int buf_len, 851 int buf_len,
852 const CompletionCallback& callback) OVERRIDE; 852 const CompletionCallback& callback) OVERRIDE;
853 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; 853 virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
854 virtual bool SetSendBufferSize(int32 size) OVERRIDE; 854 virtual int SetSendBufferSize(int32 size) OVERRIDE;
855 855
856 // DatagramSocket implementation. 856 // DatagramSocket implementation.
857 virtual void Close() OVERRIDE; 857 virtual void Close() OVERRIDE;
858 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; 858 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
859 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; 859 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
860 virtual const BoundNetLog& NetLog() const OVERRIDE; 860 virtual const BoundNetLog& NetLog() const OVERRIDE;
861 861
862 // DatagramClientSocket implementation. 862 // DatagramClientSocket implementation.
863 virtual int Connect(const IPEndPoint& address) OVERRIDE; 863 virtual int Connect(const IPEndPoint& address) OVERRIDE;
864 864
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 MockUDPClientSocket(SocketDataProvider* data, net::NetLog* net_log); 985 MockUDPClientSocket(SocketDataProvider* data, net::NetLog* net_log);
986 virtual ~MockUDPClientSocket(); 986 virtual ~MockUDPClientSocket();
987 987
988 // Socket implementation. 988 // Socket implementation.
989 virtual int Read(IOBuffer* buf, 989 virtual int Read(IOBuffer* buf,
990 int buf_len, 990 int buf_len,
991 const CompletionCallback& callback) OVERRIDE; 991 const CompletionCallback& callback) OVERRIDE;
992 virtual int Write(IOBuffer* buf, 992 virtual int Write(IOBuffer* buf,
993 int buf_len, 993 int buf_len,
994 const CompletionCallback& callback) OVERRIDE; 994 const CompletionCallback& callback) OVERRIDE;
995 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; 995 virtual int SetReceiveBufferSize(int32 size) OVERRIDE;
996 virtual bool SetSendBufferSize(int32 size) OVERRIDE; 996 virtual int SetSendBufferSize(int32 size) OVERRIDE;
997 997
998 // DatagramSocket implementation. 998 // DatagramSocket implementation.
999 virtual void Close() OVERRIDE; 999 virtual void Close() OVERRIDE;
1000 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; 1000 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
1001 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; 1001 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE;
1002 virtual const BoundNetLog& NetLog() const OVERRIDE; 1002 virtual const BoundNetLog& NetLog() const OVERRIDE;
1003 1003
1004 // DatagramClientSocket implementation. 1004 // DatagramClientSocket implementation.
1005 virtual int Connect(const IPEndPoint& address) OVERRIDE; 1005 virtual int Connect(const IPEndPoint& address) OVERRIDE;
1006 1006
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 1284
1285 extern const char kSOCKS5OkRequest[]; 1285 extern const char kSOCKS5OkRequest[];
1286 extern const int kSOCKS5OkRequestLength; 1286 extern const int kSOCKS5OkRequestLength;
1287 1287
1288 extern const char kSOCKS5OkResponse[]; 1288 extern const char kSOCKS5OkResponse[];
1289 extern const int kSOCKS5OkResponseLength; 1289 extern const int kSOCKS5OkResponseLength;
1290 1290
1291 } // namespace net 1291 } // namespace net
1292 1292
1293 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1293 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698