| 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_SOCKS5_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Deprecated constructor (http://crbug.com/37810) that takes a StreamSocket. | 44 // Deprecated constructor (http://crbug.com/37810) that takes a StreamSocket. |
| 45 SOCKS5ClientSocket(StreamSocket* transport_socket, | 45 SOCKS5ClientSocket(StreamSocket* transport_socket, |
| 46 const HostResolver::RequestInfo& req_info); | 46 const HostResolver::RequestInfo& req_info); |
| 47 | 47 |
| 48 // On destruction Disconnect() is called. | 48 // On destruction Disconnect() is called. |
| 49 virtual ~SOCKS5ClientSocket(); | 49 virtual ~SOCKS5ClientSocket(); |
| 50 | 50 |
| 51 // StreamSocket methods: | 51 // StreamSocket methods: |
| 52 | 52 |
| 53 // Does the SOCKS handshake and completes the protocol. | 53 // Does the SOCKS handshake and completes the protocol. |
| 54 virtual int Connect(OldCompletionCallback* callback); | 54 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; |
| 55 virtual void Disconnect(); | 55 virtual void Disconnect() OVERRIDE; |
| 56 virtual bool IsConnected() const; | 56 virtual bool IsConnected() const OVERRIDE; |
| 57 virtual bool IsConnectedAndIdle() const; | 57 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 58 virtual const BoundNetLog& NetLog() const; | 58 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 59 virtual void SetSubresourceSpeculation(); | 59 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 60 virtual void SetOmniboxSpeculation(); | 60 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 61 virtual bool WasEverUsed() const; | 61 virtual bool WasEverUsed() const OVERRIDE; |
| 62 virtual bool UsingTCPFastOpen() const; | 62 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 63 virtual int64 NumBytesRead() const; | 63 virtual int64 NumBytesRead() const OVERRIDE; |
| 64 virtual base::TimeDelta GetConnectTimeMicros() const; | 64 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| 65 | 65 |
| 66 // Socket methods: | 66 // Socket methods: |
| 67 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | 67 virtual int Read(IOBuffer* buf, |
| 68 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; | 68 int buf_len, |
| 69 OldCompletionCallback* callback) OVERRIDE; |
| 70 virtual int Write(IOBuffer* buf, |
| 71 int buf_len, |
| 72 OldCompletionCallback* callback) OVERRIDE; |
| 69 | 73 |
| 70 virtual bool SetReceiveBufferSize(int32 size); | 74 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 71 virtual bool SetSendBufferSize(int32 size); | 75 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 72 | 76 |
| 73 virtual int GetPeerAddress(AddressList* address) const; | 77 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; |
| 74 virtual int GetLocalAddress(IPEndPoint* address) const; | 78 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
| 75 | 79 |
| 76 private: | 80 private: |
| 77 enum State { | 81 enum State { |
| 78 STATE_GREET_WRITE, | 82 STATE_GREET_WRITE, |
| 79 STATE_GREET_WRITE_COMPLETE, | 83 STATE_GREET_WRITE_COMPLETE, |
| 80 STATE_GREET_READ, | 84 STATE_GREET_READ, |
| 81 STATE_GREET_READ_COMPLETE, | 85 STATE_GREET_READ_COMPLETE, |
| 82 STATE_HANDSHAKE_WRITE, | 86 STATE_HANDSHAKE_WRITE, |
| 83 STATE_HANDSHAKE_WRITE_COMPLETE, | 87 STATE_HANDSHAKE_WRITE_COMPLETE, |
| 84 STATE_HANDSHAKE_READ, | 88 STATE_HANDSHAKE_READ, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 HostResolver::RequestInfo host_request_info_; | 153 HostResolver::RequestInfo host_request_info_; |
| 150 | 154 |
| 151 BoundNetLog net_log_; | 155 BoundNetLog net_log_; |
| 152 | 156 |
| 153 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); | 157 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); |
| 154 }; | 158 }; |
| 155 | 159 |
| 156 } // namespace net | 160 } // namespace net |
| 157 | 161 |
| 158 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ | 162 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
| OLD | NEW |