| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) OVERRIDE; | 54 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; |
| 55 virtual int Connect(const CompletionCallback& callback) OVERRIDE; |
| 55 virtual void Disconnect() OVERRIDE; | 56 virtual void Disconnect() OVERRIDE; |
| 56 virtual bool IsConnected() const OVERRIDE; | 57 virtual bool IsConnected() const OVERRIDE; |
| 57 virtual bool IsConnectedAndIdle() const OVERRIDE; | 58 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 58 virtual const BoundNetLog& NetLog() const OVERRIDE; | 59 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 59 virtual void SetSubresourceSpeculation() OVERRIDE; | 60 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 60 virtual void SetOmniboxSpeculation() OVERRIDE; | 61 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 61 virtual bool WasEverUsed() const OVERRIDE; | 62 virtual bool WasEverUsed() const OVERRIDE; |
| 62 virtual bool UsingTCPFastOpen() const OVERRIDE; | 63 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 63 virtual int64 NumBytesRead() const OVERRIDE; | 64 virtual int64 NumBytesRead() const OVERRIDE; |
| 64 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; | 65 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 int BuildHandshakeWriteBuffer(std::string* handshake) const; | 123 int BuildHandshakeWriteBuffer(std::string* handshake) const; |
| 123 | 124 |
| 124 OldCompletionCallbackImpl<SOCKS5ClientSocket> io_callback_; | 125 OldCompletionCallbackImpl<SOCKS5ClientSocket> io_callback_; |
| 125 | 126 |
| 126 // Stores the underlying socket. | 127 // Stores the underlying socket. |
| 127 scoped_ptr<ClientSocketHandle> transport_; | 128 scoped_ptr<ClientSocketHandle> transport_; |
| 128 | 129 |
| 129 State next_state_; | 130 State next_state_; |
| 130 | 131 |
| 131 // Stores the callback to the layer above, called on completing Connect(). | 132 // Stores the callback to the layer above, called on completing Connect(). |
| 132 OldCompletionCallback* user_callback_; | 133 OldCompletionCallback* old_user_callback_; |
| 134 CompletionCallback user_callback_; |
| 133 | 135 |
| 134 // This IOBuffer is used by the class to read and write | 136 // This IOBuffer is used by the class to read and write |
| 135 // SOCKS handshake data. The length contains the expected size to | 137 // SOCKS handshake data. The length contains the expected size to |
| 136 // read or write. | 138 // read or write. |
| 137 scoped_refptr<IOBuffer> handshake_buf_; | 139 scoped_refptr<IOBuffer> handshake_buf_; |
| 138 | 140 |
| 139 // While writing, this buffer stores the complete write handshake data. | 141 // While writing, this buffer stores the complete write handshake data. |
| 140 // While reading, it stores the handshake information received so far. | 142 // While reading, it stores the handshake information received so far. |
| 141 std::string buffer_; | 143 std::string buffer_; |
| 142 | 144 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 153 HostResolver::RequestInfo host_request_info_; | 155 HostResolver::RequestInfo host_request_info_; |
| 154 | 156 |
| 155 BoundNetLog net_log_; | 157 BoundNetLog net_log_; |
| 156 | 158 |
| 157 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); | 159 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); |
| 158 }; | 160 }; |
| 159 | 161 |
| 160 } // namespace net | 162 } // namespace net |
| 161 | 163 |
| 162 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ | 164 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
| OLD | NEW |