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 #include "net/socket/socks_client_socket_pool.h" | 5 #include "net/socket/socks_client_socket_pool.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 SOCKSClientSocketPool::SOCKSConnectJobFactory::ConnectionTimeout() const { | 181 SOCKSClientSocketPool::SOCKSConnectJobFactory::ConnectionTimeout() const { |
182 return transport_pool_->ConnectionTimeout() + | 182 return transport_pool_->ConnectionTimeout() + |
183 base::TimeDelta::FromSeconds(kSOCKSConnectJobTimeoutInSeconds); | 183 base::TimeDelta::FromSeconds(kSOCKSConnectJobTimeoutInSeconds); |
184 } | 184 } |
185 | 185 |
186 SOCKSClientSocketPool::SOCKSClientSocketPool( | 186 SOCKSClientSocketPool::SOCKSClientSocketPool( |
187 int max_sockets, | 187 int max_sockets, |
188 int max_sockets_per_group, | 188 int max_sockets_per_group, |
189 HostResolver* host_resolver, | 189 HostResolver* host_resolver, |
190 TransportClientSocketPool* transport_pool, | 190 TransportClientSocketPool* transport_pool, |
| 191 SocketPerformanceWatcherFactory*, |
191 NetLog* net_log) | 192 NetLog* net_log) |
192 : transport_pool_(transport_pool), | 193 : transport_pool_(transport_pool), |
193 base_( | 194 base_( |
194 this, | 195 this, |
195 max_sockets, | 196 max_sockets, |
196 max_sockets_per_group, | 197 max_sockets_per_group, |
197 ClientSocketPool::unused_idle_socket_timeout(), | 198 ClientSocketPool::unused_idle_socket_timeout(), |
198 ClientSocketPool::used_idle_socket_timeout(), | 199 ClientSocketPool::used_idle_socket_timeout(), |
199 new SOCKSConnectJobFactory(transport_pool, host_resolver, net_log)) { | 200 new SOCKSConnectJobFactory(transport_pool, host_resolver, net_log)) { |
200 // We should always have a |transport_pool_| except in unit tests. | 201 // We should always have a |transport_pool_| except in unit tests. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 base_.RemoveHigherLayeredPool(higher_pool); | 297 base_.RemoveHigherLayeredPool(higher_pool); |
297 } | 298 } |
298 | 299 |
299 bool SOCKSClientSocketPool::CloseOneIdleConnection() { | 300 bool SOCKSClientSocketPool::CloseOneIdleConnection() { |
300 if (base_.CloseOneIdleSocket()) | 301 if (base_.CloseOneIdleSocket()) |
301 return true; | 302 return true; |
302 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 303 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
303 } | 304 } |
304 | 305 |
305 } // namespace net | 306 } // namespace net |
OLD | NEW |