OLD | NEW |
---|---|
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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
696 virtual void Disconnect() OVERRIDE; | 696 virtual void Disconnect() OVERRIDE; |
697 virtual bool IsConnected() const OVERRIDE; | 697 virtual bool IsConnected() const OVERRIDE; |
698 virtual bool IsConnectedAndIdle() const OVERRIDE; | 698 virtual bool IsConnectedAndIdle() const OVERRIDE; |
699 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; | 699 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; |
700 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; | 700 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
701 virtual const BoundNetLog& NetLog() const OVERRIDE; | 701 virtual const BoundNetLog& NetLog() const OVERRIDE; |
702 virtual void SetSubresourceSpeculation() OVERRIDE {} | 702 virtual void SetSubresourceSpeculation() OVERRIDE {} |
703 virtual void SetOmniboxSpeculation() OVERRIDE {} | 703 virtual void SetOmniboxSpeculation() OVERRIDE {} |
704 | 704 |
705 // SSLClientSocket implementation. | 705 // SSLClientSocket implementation. |
706 virtual std::string GetSessionCacheKey() const OVERRIDE; | |
706 virtual bool InSessionCache() const OVERRIDE; | 707 virtual bool InSessionCache() const OVERRIDE; |
707 virtual void SetHandshakeCompletionCallback(const base::Closure& cb) OVERRIDE; | 708 virtual void SetHandshakeCompletionCallback(const base::Closure& cb) OVERRIDE; |
708 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) | 709 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) |
709 OVERRIDE; | 710 OVERRIDE; |
710 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 711 virtual int ExportKeyingMaterial(const base::StringPiece& label, |
711 bool has_context, | 712 bool has_context, |
712 const base::StringPiece& context, | 713 const base::StringPiece& context, |
713 unsigned char* out, | 714 unsigned char* out, |
714 unsigned int outlen) OVERRIDE; | 715 unsigned int outlen) OVERRIDE; |
715 virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE; | 716 virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
957 virtual int Connect(const CompletionCallback& callback) OVERRIDE; | 958 virtual int Connect(const CompletionCallback& callback) OVERRIDE; |
958 virtual void Disconnect() OVERRIDE; | 959 virtual void Disconnect() OVERRIDE; |
959 virtual bool IsConnected() const OVERRIDE; | 960 virtual bool IsConnected() const OVERRIDE; |
960 virtual bool WasEverUsed() const OVERRIDE; | 961 virtual bool WasEverUsed() const OVERRIDE; |
961 virtual bool UsingTCPFastOpen() const OVERRIDE; | 962 virtual bool UsingTCPFastOpen() const OVERRIDE; |
962 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; | 963 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; |
963 virtual bool WasNpnNegotiated() const OVERRIDE; | 964 virtual bool WasNpnNegotiated() const OVERRIDE; |
964 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 965 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
965 | 966 |
966 // SSLClientSocket implementation. | 967 // SSLClientSocket implementation. |
968 virtual std::string GetSessionCacheKey() const OVERRIDE; | |
967 virtual bool InSessionCache() const OVERRIDE; | 969 virtual bool InSessionCache() const OVERRIDE; |
968 virtual void SetHandshakeCompletionCallback(const base::Closure& cb) OVERRIDE; | 970 virtual void SetHandshakeCompletionCallback(const base::Closure& cb) OVERRIDE; |
969 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) | 971 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) |
970 OVERRIDE; | 972 OVERRIDE; |
971 virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE; | 973 virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE; |
972 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE; | 974 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE; |
973 virtual void set_protocol_negotiated(NextProto protocol_negotiated) OVERRIDE; | 975 virtual void set_protocol_negotiated(NextProto protocol_negotiated) OVERRIDE; |
974 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; | 976 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; |
975 | 977 |
976 // This MockSocket does not implement the manual async IO feature. | 978 // This MockSocket does not implement the manual async IO feature. |
(...skipping 18 matching lines...) Expand all Loading... | |
995 }; | 997 }; |
996 | 998 |
997 void OnIOComplete(int result); | 999 void OnIOComplete(int result); |
998 | 1000 |
999 // Runs the state transistion loop. | 1001 // Runs the state transistion loop. |
1000 int DoConnectLoop(int result); | 1002 int DoConnectLoop(int result); |
1001 | 1003 |
1002 int DoSSLConnect(); | 1004 int DoSSLConnect(); |
1003 int DoSSLConnectComplete(int result); | 1005 int DoSSLConnectComplete(int result); |
1004 | 1006 |
1005 scoped_ptr<ClientSocketHandle> transport_; | 1007 scoped_ptr<ClientSocketHandle> transport_; |
wtc
2014/08/12 14:51:00
Nit: I suggest you declare the |host_port_pair_| m
mshelley
2014/08/12 21:47:00
Done.
| |
1006 SSLSocketDataProvider* data_; | 1008 SSLSocketDataProvider* data_; |
1007 bool is_npn_state_set_; | 1009 bool is_npn_state_set_; |
1008 bool new_npn_value_; | 1010 bool new_npn_value_; |
1009 bool is_protocol_negotiated_set_; | 1011 bool is_protocol_negotiated_set_; |
1010 NextProto protocol_negotiated_; | 1012 NextProto protocol_negotiated_; |
1013 HostPortPair host_port_pair_; | |
1011 | 1014 |
1012 CompletionCallback connect_callback_; | 1015 CompletionCallback connect_callback_; |
1013 // Indicates what state of Connect the socket should enter. | 1016 // Indicates what state of Connect the socket should enter. |
1014 ConnectState next_connect_state_; | 1017 ConnectState next_connect_state_; |
1015 // True if the Connect method has been called on the socket. | 1018 // True if the Connect method has been called on the socket. |
1016 bool reached_connect_; | 1019 bool reached_connect_; |
1017 | 1020 |
1018 base::Closure handshake_completion_callback_; | 1021 base::Closure handshake_completion_callback_; |
1019 | 1022 |
1020 base::WeakPtrFactory<MockSSLClientSocket> weak_factory_; | 1023 base::WeakPtrFactory<MockSSLClientSocket> weak_factory_; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1326 | 1329 |
1327 extern const char kSOCKS5OkRequest[]; | 1330 extern const char kSOCKS5OkRequest[]; |
1328 extern const int kSOCKS5OkRequestLength; | 1331 extern const int kSOCKS5OkRequestLength; |
1329 | 1332 |
1330 extern const char kSOCKS5OkResponse[]; | 1333 extern const char kSOCKS5OkResponse[]; |
1331 extern const int kSOCKS5OkResponseLength; | 1334 extern const int kSOCKS5OkResponseLength; |
1332 | 1335 |
1333 } // namespace net | 1336 } // namespace net |
1334 | 1337 |
1335 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 1338 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
OLD | NEW |