| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SOCKS_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 SOCKSClientSocket(StreamSocket* transport_socket, | 42 SOCKSClientSocket(StreamSocket* transport_socket, |
| 43 const HostResolver::RequestInfo& req_info, | 43 const HostResolver::RequestInfo& req_info, |
| 44 HostResolver* host_resolver); | 44 HostResolver* host_resolver); |
| 45 | 45 |
| 46 // On destruction Disconnect() is called. | 46 // On destruction Disconnect() is called. |
| 47 virtual ~SOCKSClientSocket(); | 47 virtual ~SOCKSClientSocket(); |
| 48 | 48 |
| 49 // StreamSocket methods: | 49 // StreamSocket methods: |
| 50 | 50 |
| 51 // Does the SOCKS handshake and completes the protocol. | 51 // Does the SOCKS handshake and completes the protocol. |
| 52 virtual int Connect(OldCompletionCallback* callback); | 52 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; |
| 53 virtual void Disconnect(); | 53 virtual void Disconnect() OVERRIDE; |
| 54 virtual bool IsConnected() const; | 54 virtual bool IsConnected() const OVERRIDE; |
| 55 virtual bool IsConnectedAndIdle() const; | 55 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 56 virtual const BoundNetLog& NetLog() const; | 56 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 57 virtual void SetSubresourceSpeculation(); | 57 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 58 virtual void SetOmniboxSpeculation(); | 58 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 59 virtual bool WasEverUsed() const; | 59 virtual bool WasEverUsed() const OVERRIDE; |
| 60 virtual bool UsingTCPFastOpen() const; | 60 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 61 virtual int64 NumBytesRead() const; | 61 virtual int64 NumBytesRead() const OVERRIDE; |
| 62 virtual base::TimeDelta GetConnectTimeMicros() const; | 62 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| 63 | 63 |
| 64 // Socket methods: | 64 // Socket methods: |
| 65 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | 65 virtual int Read(IOBuffer* buf, |
| 66 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; | 66 int buf_len, |
| 67 OldCompletionCallback* callback) OVERRIDE; |
| 68 virtual int Write(IOBuffer* buf, |
| 69 int buf_len, |
| 70 OldCompletionCallback* callback) OVERRIDE; |
| 67 | 71 |
| 68 virtual bool SetReceiveBufferSize(int32 size); | 72 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 69 virtual bool SetSendBufferSize(int32 size); | 73 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 70 | 74 |
| 71 virtual int GetPeerAddress(AddressList* address) const; | 75 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; |
| 72 virtual int GetLocalAddress(IPEndPoint* address) const; | 76 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
| 73 | 77 |
| 74 private: | 78 private: |
| 75 FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, CompleteHandshake); | 79 FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, CompleteHandshake); |
| 76 FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, SOCKS4AFailedDNS); | 80 FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, SOCKS4AFailedDNS); |
| 77 FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, SOCKS4AIfDomainInIPv6); | 81 FRIEND_TEST_ALL_PREFIXES(SOCKSClientSocketTest, SOCKS4AIfDomainInIPv6); |
| 78 | 82 |
| 79 enum State { | 83 enum State { |
| 80 STATE_RESOLVE_HOST, | 84 STATE_RESOLVE_HOST, |
| 81 STATE_RESOLVE_HOST_COMPLETE, | 85 STATE_RESOLVE_HOST_COMPLETE, |
| 82 STATE_HANDSHAKE_WRITE, | 86 STATE_HANDSHAKE_WRITE, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 HostResolver::RequestInfo host_request_info_; | 136 HostResolver::RequestInfo host_request_info_; |
| 133 | 137 |
| 134 BoundNetLog net_log_; | 138 BoundNetLog net_log_; |
| 135 | 139 |
| 136 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocket); | 140 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocket); |
| 137 }; | 141 }; |
| 138 | 142 |
| 139 } // namespace net | 143 } // namespace net |
| 140 | 144 |
| 141 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ | 145 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ |
| OLD | NEW |