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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/socket/client_socket_factory.h" | 12 #include "net/socket/client_socket_factory.h" |
13 #include "net/socket/client_socket_handle.h" | 13 #include "net/socket/client_socket_handle.h" |
14 #include "net/socket/client_socket_pool_base.h" | 14 #include "net/socket/client_socket_pool_base.h" |
15 #include "net/socket/socks5_client_socket.h" | 15 #include "net/socket/socks5_client_socket.h" |
16 #include "net/socket/socks_client_socket.h" | 16 #include "net/socket/socks_client_socket.h" |
17 #include "net/socket/transport_client_socket_pool.h" | 17 #include "net/socket/transport_client_socket_pool.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 SOCKSSocketParams::SOCKSSocketParams( | 21 SOCKSSocketParams::SOCKSSocketParams( |
22 const scoped_refptr<TransportSocketParams>& proxy_server, | 22 const scoped_refptr<TransportSocketParams>& proxy_server, |
23 bool socks_v5, | 23 bool socks_v5, |
24 const HostPortPair& host_port_pair, | 24 const HostPortPair& host_port_pair, |
25 RequestPriority priority) | 25 RequestPriority priority) |
26 : transport_params_(proxy_server), | 26 : transport_params_(proxy_server), |
27 destination_(host_port_pair), | 27 destination_(host_port_pair), |
28 socks_v5_(socks_v5) { | 28 socks_v5_(socks_v5) { |
29 if (transport_params_) | 29 if (transport_params_.get()) |
30 ignore_limits_ = transport_params_->ignore_limits(); | 30 ignore_limits_ = transport_params_->ignore_limits(); |
31 else | 31 else |
32 ignore_limits_ = false; | 32 ignore_limits_ = false; |
33 destination_.set_priority(priority); | 33 destination_.set_priority(priority); |
34 } | 34 } |
35 | 35 |
36 SOCKSSocketParams::~SOCKSSocketParams() {} | 36 SOCKSSocketParams::~SOCKSSocketParams() {} |
37 | 37 |
38 // SOCKSConnectJobs will time out after this many seconds. Note this is on | 38 // SOCKSConnectJobs will time out after this many seconds. Note this is on |
39 // top of the timeout for the transport socket. | 39 // top of the timeout for the transport socket. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 return base_.histograms(); | 299 return base_.histograms(); |
300 }; | 300 }; |
301 | 301 |
302 bool SOCKSClientSocketPool::CloseOneIdleConnection() { | 302 bool SOCKSClientSocketPool::CloseOneIdleConnection() { |
303 if (base_.CloseOneIdleSocket()) | 303 if (base_.CloseOneIdleSocket()) |
304 return true; | 304 return true; |
305 return base_.CloseOneIdleConnectionInLayeredPool(); | 305 return base_.CloseOneIdleConnectionInLayeredPool(); |
306 } | 306 } |
307 | 307 |
308 } // namespace net | 308 } // namespace net |
OLD | NEW |