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

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

Issue 12886034: Remove experimental code to pick the "warmest" socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync, fix conflict Created 7 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
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | net/socket/socket_test_util.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 #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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 const CompletionCallback& callback) OVERRIDE; 658 const CompletionCallback& callback) OVERRIDE;
659 659
660 // StreamSocket implementation. 660 // StreamSocket implementation.
661 virtual int Connect(const CompletionCallback& callback) OVERRIDE; 661 virtual int Connect(const CompletionCallback& callback) OVERRIDE;
662 virtual void Disconnect() OVERRIDE; 662 virtual void Disconnect() OVERRIDE;
663 virtual bool IsConnected() const OVERRIDE; 663 virtual bool IsConnected() const OVERRIDE;
664 virtual bool IsConnectedAndIdle() const OVERRIDE; 664 virtual bool IsConnectedAndIdle() const OVERRIDE;
665 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; 665 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
666 virtual bool WasEverUsed() const OVERRIDE; 666 virtual bool WasEverUsed() const OVERRIDE;
667 virtual bool UsingTCPFastOpen() const OVERRIDE; 667 virtual bool UsingTCPFastOpen() const OVERRIDE;
668 virtual int64 NumBytesRead() const OVERRIDE;
669 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
670 virtual bool WasNpnNegotiated() const OVERRIDE; 668 virtual bool WasNpnNegotiated() const OVERRIDE;
671 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; 669 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
672 670
673 // AsyncSocket: 671 // AsyncSocket:
674 virtual void OnReadComplete(const MockRead& data) OVERRIDE; 672 virtual void OnReadComplete(const MockRead& data) OVERRIDE;
675 673
676 private: 674 private:
677 int CompleteRead(); 675 int CompleteRead();
678 676
679 AddressList addresses_; 677 AddressList addresses_;
680 678
681 SocketDataProvider* data_; 679 SocketDataProvider* data_;
682 int read_offset_; 680 int read_offset_;
683 int num_bytes_read_;
684 MockRead read_data_; 681 MockRead read_data_;
685 bool need_read_data_; 682 bool need_read_data_;
686 683
687 // True if the peer has closed the connection. This allows us to simulate 684 // True if the peer has closed the connection. This allows us to simulate
688 // the recv(..., MSG_PEEK) call in the IsConnectedAndIdle method of the real 685 // the recv(..., MSG_PEEK) call in the IsConnectedAndIdle method of the real
689 // TCPClientSocket. 686 // TCPClientSocket.
690 bool peer_closed_connection_; 687 bool peer_closed_connection_;
691 688
692 // While an asynchronous IO is pending, we save our user-buffer state. 689 // While an asynchronous IO is pending, we save our user-buffer state.
693 IOBuffer* pending_buf_; 690 IOBuffer* pending_buf_;
(...skipping 24 matching lines...) Expand all
718 virtual int Read(IOBuffer* buf, int buf_len, 715 virtual int Read(IOBuffer* buf, int buf_len,
719 const CompletionCallback& callback) OVERRIDE; 716 const CompletionCallback& callback) OVERRIDE;
720 717
721 // StreamSocket implementation. 718 // StreamSocket implementation.
722 virtual int Connect(const CompletionCallback& callback) OVERRIDE; 719 virtual int Connect(const CompletionCallback& callback) OVERRIDE;
723 virtual void Disconnect() OVERRIDE; 720 virtual void Disconnect() OVERRIDE;
724 virtual bool IsConnected() const OVERRIDE; 721 virtual bool IsConnected() const OVERRIDE;
725 virtual bool IsConnectedAndIdle() const OVERRIDE; 722 virtual bool IsConnectedAndIdle() const OVERRIDE;
726 virtual bool WasEverUsed() const OVERRIDE; 723 virtual bool WasEverUsed() const OVERRIDE;
727 virtual bool UsingTCPFastOpen() const OVERRIDE; 724 virtual bool UsingTCPFastOpen() const OVERRIDE;
728 virtual int64 NumBytesRead() const OVERRIDE;
729 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
730 virtual bool WasNpnNegotiated() const OVERRIDE; 725 virtual bool WasNpnNegotiated() const OVERRIDE;
731 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; 726 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
732 727
733 // AsyncSocket: 728 // AsyncSocket:
734 virtual void OnReadComplete(const MockRead& data) OVERRIDE; 729 virtual void OnReadComplete(const MockRead& data) OVERRIDE;
735 730
736 private: 731 private:
737 bool write_pending_; 732 bool write_pending_;
738 CompletionCallback write_callback_; 733 CompletionCallback write_callback_;
739 int write_result_; 734 int write_result_;
(...skipping 22 matching lines...) Expand all
762 const CompletionCallback& callback) OVERRIDE; 757 const CompletionCallback& callback) OVERRIDE;
763 virtual int Write(IOBuffer* buf, int buf_len, 758 virtual int Write(IOBuffer* buf, int buf_len,
764 const CompletionCallback& callback) OVERRIDE; 759 const CompletionCallback& callback) OVERRIDE;
765 760
766 // StreamSocket implementation. 761 // StreamSocket implementation.
767 virtual int Connect(const CompletionCallback& callback) OVERRIDE; 762 virtual int Connect(const CompletionCallback& callback) OVERRIDE;
768 virtual void Disconnect() OVERRIDE; 763 virtual void Disconnect() OVERRIDE;
769 virtual bool IsConnected() const OVERRIDE; 764 virtual bool IsConnected() const OVERRIDE;
770 virtual bool WasEverUsed() const OVERRIDE; 765 virtual bool WasEverUsed() const OVERRIDE;
771 virtual bool UsingTCPFastOpen() const OVERRIDE; 766 virtual bool UsingTCPFastOpen() const OVERRIDE;
772 virtual int64 NumBytesRead() const OVERRIDE;
773 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; 767 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE;
774 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
775 virtual bool WasNpnNegotiated() const OVERRIDE; 768 virtual bool WasNpnNegotiated() const OVERRIDE;
776 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; 769 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE;
777 770
778 // SSLClientSocket implementation. 771 // SSLClientSocket implementation.
779 virtual void GetSSLCertRequestInfo( 772 virtual void GetSSLCertRequestInfo(
780 SSLCertRequestInfo* cert_request_info) OVERRIDE; 773 SSLCertRequestInfo* cert_request_info) OVERRIDE;
781 virtual NextProtoStatus GetNextProto(std::string* proto, 774 virtual NextProtoStatus GetNextProto(std::string* proto,
782 std::string* server_protos) OVERRIDE; 775 std::string* server_protos) OVERRIDE;
783 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE; 776 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE;
784 virtual void set_protocol_negotiated( 777 virtual void set_protocol_negotiated(
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 1067
1075 extern const char kSOCKS5OkRequest[]; 1068 extern const char kSOCKS5OkRequest[];
1076 extern const int kSOCKS5OkRequestLength; 1069 extern const int kSOCKS5OkRequestLength;
1077 1070
1078 extern const char kSOCKS5OkResponse[]; 1071 extern const char kSOCKS5OkResponse[];
1079 extern const int kSOCKS5OkResponseLength; 1072 extern const int kSOCKS5OkResponseLength;
1080 1073
1081 } // namespace net 1074 } // namespace net
1082 1075
1083 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1076 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698