OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Deprecated constructor (http://crbug.com/37810) that takes a ClientSocket. | 43 // Deprecated constructor (http://crbug.com/37810) that takes a ClientSocket. |
44 SOCKS5ClientSocket(ClientSocket* transport_socket, | 44 SOCKS5ClientSocket(ClientSocket* transport_socket, |
45 const HostResolver::RequestInfo& req_info); | 45 const HostResolver::RequestInfo& req_info); |
46 | 46 |
47 // On destruction Disconnect() is called. | 47 // On destruction Disconnect() is called. |
48 virtual ~SOCKS5ClientSocket(); | 48 virtual ~SOCKS5ClientSocket(); |
49 | 49 |
50 // ClientSocket methods: | 50 // ClientSocket methods: |
51 | 51 |
52 // Does the SOCKS handshake and completes the protocol. | 52 // Does the SOCKS handshake and completes the protocol. |
53 virtual int Connect(CompletionCallback* callback, const BoundNetLog& net_log); | 53 virtual int Connect(CompletionCallback* callback); |
54 virtual void Disconnect(); | 54 virtual void Disconnect(); |
55 virtual bool IsConnected() const; | 55 virtual bool IsConnected() const; |
56 virtual bool IsConnectedAndIdle() const; | 56 virtual bool IsConnectedAndIdle() const; |
| 57 virtual const BoundNetLog& NetLog() const { return net_log_; } |
57 | 58 |
58 // Socket methods: | 59 // Socket methods: |
59 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 60 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
60 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 61 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
61 | 62 |
62 virtual bool SetReceiveBufferSize(int32 size); | 63 virtual bool SetReceiveBufferSize(int32 size); |
63 virtual bool SetSendBufferSize(int32 size); | 64 virtual bool SetSendBufferSize(int32 size); |
64 | 65 |
65 virtual int GetPeerAddress(AddressList* address) const; | 66 virtual int GetPeerAddress(AddressList* address) const; |
66 | 67 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 HostResolver::RequestInfo host_request_info_; | 141 HostResolver::RequestInfo host_request_info_; |
141 | 142 |
142 BoundNetLog net_log_; | 143 BoundNetLog net_log_; |
143 | 144 |
144 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); | 145 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); |
145 }; | 146 }; |
146 | 147 |
147 } // namespace net | 148 } // namespace net |
148 | 149 |
149 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ | 150 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ |
OLD | NEW |