| 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 const HostResolver::RequestInfo& req_info, | 42 const HostResolver::RequestInfo& req_info, |
| 43 HostResolver* host_resolver); | 43 HostResolver* host_resolver); |
| 44 | 44 |
| 45 // On destruction Disconnect() is called. | 45 // On destruction Disconnect() is called. |
| 46 virtual ~SOCKSClientSocket(); | 46 virtual ~SOCKSClientSocket(); |
| 47 | 47 |
| 48 // StreamSocket methods: | 48 // StreamSocket methods: |
| 49 | 49 |
| 50 // Does the SOCKS handshake and completes the protocol. | 50 // Does the SOCKS handshake and completes the protocol. |
| 51 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; | 51 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; |
| 52 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; |
| 52 virtual void Disconnect() OVERRIDE; | 53 virtual void Disconnect() OVERRIDE; |
| 53 virtual bool IsConnected() const OVERRIDE; | 54 virtual bool IsConnected() const OVERRIDE; |
| 54 virtual bool IsConnectedAndIdle() const OVERRIDE; | 55 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 55 virtual const BoundNetLog& NetLog() const OVERRIDE; | 56 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 56 virtual void SetSubresourceSpeculation() OVERRIDE; | 57 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 57 virtual void SetOmniboxSpeculation() OVERRIDE; | 58 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 58 virtual bool WasEverUsed() const OVERRIDE; | 59 virtual bool WasEverUsed() const OVERRIDE; |
| 59 virtual bool UsingTCPFastOpen() const OVERRIDE; | 60 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 60 virtual int64 NumBytesRead() const OVERRIDE; | 61 virtual int64 NumBytesRead() const OVERRIDE; |
| 61 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; | 62 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const std::string BuildHandshakeWriteBuffer() const; | 104 const std::string BuildHandshakeWriteBuffer() const; |
| 104 | 105 |
| 105 OldCompletionCallbackImpl<SOCKSClientSocket> io_callback_; | 106 OldCompletionCallbackImpl<SOCKSClientSocket> io_callback_; |
| 106 | 107 |
| 107 // Stores the underlying socket. | 108 // Stores the underlying socket. |
| 108 scoped_ptr<ClientSocketHandle> transport_; | 109 scoped_ptr<ClientSocketHandle> transport_; |
| 109 | 110 |
| 110 State next_state_; | 111 State next_state_; |
| 111 | 112 |
| 112 // Stores the callback to the layer above, called on completing Connect(). | 113 // Stores the callback to the layer above, called on completing Connect(). |
| 113 OldCompletionCallback* user_callback_; | 114 OldCompletionCallback* old_user_callback_; |
| 115 CompletionCallback user_callback_; |
| 114 | 116 |
| 115 // This IOBuffer is used by the class to read and write | 117 // This IOBuffer is used by the class to read and write |
| 116 // SOCKS handshake data. The length contains the expected size to | 118 // SOCKS handshake data. The length contains the expected size to |
| 117 // read or write. | 119 // read or write. |
| 118 scoped_refptr<IOBuffer> handshake_buf_; | 120 scoped_refptr<IOBuffer> handshake_buf_; |
| 119 | 121 |
| 120 // While writing, this buffer stores the complete write handshake data. | 122 // While writing, this buffer stores the complete write handshake data. |
| 121 // While reading, it stores the handshake information received so far. | 123 // While reading, it stores the handshake information received so far. |
| 122 std::string buffer_; | 124 std::string buffer_; |
| 123 | 125 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 135 HostResolver::RequestInfo host_request_info_; | 137 HostResolver::RequestInfo host_request_info_; |
| 136 | 138 |
| 137 BoundNetLog net_log_; | 139 BoundNetLog net_log_; |
| 138 | 140 |
| 139 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocket); | 141 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocket); |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 } // namespace net | 144 } // namespace net |
| 143 | 145 |
| 144 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ | 146 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ |
| OLD | NEW |