| 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 #include "net/socket/socks_client_socket_pool.h" | 5 #include "net/socket/socks_client_socket_pool.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/socket/client_socket_factory.h" | 11 #include "net/socket/client_socket_factory.h" |
| 12 #include "net/socket/client_socket_handle.h" | 12 #include "net/socket/client_socket_handle.h" |
| 13 #include "net/socket/client_socket_pool_base.h" | 13 #include "net/socket/client_socket_pool_base.h" |
| 14 #include "net/socket/socks5_client_socket.h" | 14 #include "net/socket/socks5_client_socket.h" |
| 15 #include "net/socket/socks_client_socket.h" | 15 #include "net/socket/socks_client_socket.h" |
| 16 #include "net/socket/transport_client_socket_pool.h" | 16 #include "net/socket/transport_client_socket_pool.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 // TODO(szym): remove unneeded referrer |
| 20 SOCKSSocketParams::SOCKSSocketParams( | 21 SOCKSSocketParams::SOCKSSocketParams( |
| 21 const scoped_refptr<TransportSocketParams>& proxy_server, | 22 const scoped_refptr<TransportSocketParams>& proxy_server, |
| 22 bool socks_v5, | 23 bool socks_v5, |
| 23 const HostPortPair& host_port_pair, | 24 const HostPortPair& host_port_pair, |
| 24 RequestPriority priority, | 25 RequestPriority priority, |
| 25 const GURL& referrer) | 26 const GURL& referrer) |
| 26 : transport_params_(proxy_server), | 27 : transport_params_(proxy_server), |
| 27 destination_(host_port_pair), | 28 destination_(host_port_pair), |
| 28 socks_v5_(socks_v5) { | 29 socks_v5_(socks_v5) { |
| 29 if (transport_params_) | 30 if (transport_params_) |
| 30 ignore_limits_ = transport_params_->ignore_limits(); | 31 ignore_limits_ = transport_params_->ignore_limits(); |
| 31 else | 32 else |
| 32 ignore_limits_ = false; | 33 ignore_limits_ = false; |
| 33 // The referrer is used by the DNS prefetch system to correlate resolutions | |
| 34 // with the page that triggered them. It doesn't impact the actual addresses | |
| 35 // that we resolve to. | |
| 36 destination_.set_referrer(referrer); | |
| 37 destination_.set_priority(priority); | 34 destination_.set_priority(priority); |
| 38 } | 35 } |
| 39 | 36 |
| 40 SOCKSSocketParams::~SOCKSSocketParams() {} | 37 SOCKSSocketParams::~SOCKSSocketParams() {} |
| 41 | 38 |
| 42 // SOCKSConnectJobs will time out after this many seconds. Note this is on | 39 // SOCKSConnectJobs will time out after this many seconds. Note this is on |
| 43 // top of the timeout for the transport socket. | 40 // top of the timeout for the transport socket. |
| 44 static const int kSOCKSConnectJobTimeoutInSeconds = 30; | 41 static const int kSOCKSConnectJobTimeoutInSeconds = 30; |
| 45 | 42 |
| 46 SOCKSConnectJob::SOCKSConnectJob( | 43 SOCKSConnectJob::SOCKSConnectJob( |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 278 |
| 282 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { | 279 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { |
| 283 return base_.ConnectionTimeout(); | 280 return base_.ConnectionTimeout(); |
| 284 } | 281 } |
| 285 | 282 |
| 286 ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const { | 283 ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const { |
| 287 return base_.histograms(); | 284 return base_.histograms(); |
| 288 }; | 285 }; |
| 289 | 286 |
| 290 } // namespace net | 287 } // namespace net |
| OLD | NEW |