OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_POOL_H_ | 5 #ifndef NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ |
6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 class ConnectJobFactory; | 23 class ConnectJobFactory; |
24 class TransportClientSocketPool; | 24 class TransportClientSocketPool; |
25 class TransportSocketParams; | 25 class TransportSocketParams; |
26 | 26 |
27 class NET_EXPORT_PRIVATE SOCKSSocketParams | 27 class NET_EXPORT_PRIVATE SOCKSSocketParams |
28 : public base::RefCounted<SOCKSSocketParams> { | 28 : public base::RefCounted<SOCKSSocketParams> { |
29 public: | 29 public: |
30 SOCKSSocketParams(const scoped_refptr<TransportSocketParams>& proxy_server, | 30 SOCKSSocketParams(const scoped_refptr<TransportSocketParams>& proxy_server, |
31 bool socks_v5, const HostPortPair& host_port_pair); | 31 bool socks_v5, |
| 32 const HostPortPair& host_port_pair); |
32 | 33 |
33 const scoped_refptr<TransportSocketParams>& transport_params() const { | 34 const scoped_refptr<TransportSocketParams>& transport_params() const { |
34 return transport_params_; | 35 return transport_params_; |
35 } | 36 } |
36 const HostResolver::RequestInfo& destination() const { return destination_; } | 37 const HostResolver::RequestInfo& destination() const { return destination_; } |
37 bool is_socks_v5() const { return socks_v5_; } | 38 bool is_socks_v5() const { return socks_v5_; } |
38 bool ignore_limits() const { return ignore_limits_; } | 39 bool ignore_limits() const { return ignore_limits_; } |
39 | 40 |
40 private: | 41 private: |
41 friend class base::RefCounted<SOCKSSocketParams>; | 42 friend class base::RefCounted<SOCKSSocketParams>; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 HostResolver* const resolver_; | 98 HostResolver* const resolver_; |
98 | 99 |
99 State next_state_; | 100 State next_state_; |
100 CompletionCallback callback_; | 101 CompletionCallback callback_; |
101 scoped_ptr<ClientSocketHandle> transport_socket_handle_; | 102 scoped_ptr<ClientSocketHandle> transport_socket_handle_; |
102 scoped_ptr<StreamSocket> socket_; | 103 scoped_ptr<StreamSocket> socket_; |
103 | 104 |
104 DISALLOW_COPY_AND_ASSIGN(SOCKSConnectJob); | 105 DISALLOW_COPY_AND_ASSIGN(SOCKSConnectJob); |
105 }; | 106 }; |
106 | 107 |
107 class NET_EXPORT_PRIVATE SOCKSClientSocketPool | 108 class NET_EXPORT_PRIVATE SOCKSClientSocketPool : public ClientSocketPool, |
108 : public ClientSocketPool, public HigherLayeredPool { | 109 public HigherLayeredPool { |
109 public: | 110 public: |
110 typedef SOCKSSocketParams SocketParams; | 111 typedef SOCKSSocketParams SocketParams; |
111 | 112 |
112 SOCKSClientSocketPool( | 113 SOCKSClientSocketPool(int max_sockets, |
113 int max_sockets, | 114 int max_sockets_per_group, |
114 int max_sockets_per_group, | 115 ClientSocketPoolHistograms* histograms, |
115 ClientSocketPoolHistograms* histograms, | 116 HostResolver* host_resolver, |
116 HostResolver* host_resolver, | 117 TransportClientSocketPool* transport_pool, |
117 TransportClientSocketPool* transport_pool, | 118 NetLog* net_log); |
118 NetLog* net_log); | |
119 | 119 |
120 virtual ~SOCKSClientSocketPool(); | 120 virtual ~SOCKSClientSocketPool(); |
121 | 121 |
122 // ClientSocketPool implementation. | 122 // ClientSocketPool implementation. |
123 virtual int RequestSocket(const std::string& group_name, | 123 virtual int RequestSocket(const std::string& group_name, |
124 const void* connect_params, | 124 const void* connect_params, |
125 RequestPriority priority, | 125 RequestPriority priority, |
126 ClientSocketHandle* handle, | 126 ClientSocketHandle* handle, |
127 const CompletionCallback& callback, | 127 const CompletionCallback& callback, |
128 const BoundNetLog& net_log) OVERRIDE; | 128 const BoundNetLog& net_log) OVERRIDE; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 TransportClientSocketPool* const transport_pool_; | 204 TransportClientSocketPool* const transport_pool_; |
205 PoolBase base_; | 205 PoolBase base_; |
206 | 206 |
207 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocketPool); | 207 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocketPool); |
208 }; | 208 }; |
209 | 209 |
210 } // namespace net | 210 } // namespace net |
211 | 211 |
212 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ | 212 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ |
OLD | NEW |