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 SOCKSSocketParams::SOCKSSocketParams( | 20 SOCKSSocketParams::SOCKSSocketParams( |
21 const scoped_refptr<TransportSocketParams>& proxy_server, | 21 const scoped_refptr<TransportSocketParams>& proxy_server, |
22 bool socks_v5, | 22 bool socks_v5, |
23 const HostPortPair& host_port_pair, | 23 const HostPortPair& host_port_pair, |
24 RequestPriority priority, | 24 RequestPriority priority, |
25 const GURL& referrer) | 25 const GURL& referrer) |
eroman
2011/11/15 03:54:01
please add a TODO to remove the referrer.
| |
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_) |
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 // 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); | 33 destination_.set_priority(priority); |
38 } | 34 } |
39 | 35 |
40 SOCKSSocketParams::~SOCKSSocketParams() {} | 36 SOCKSSocketParams::~SOCKSSocketParams() {} |
41 | 37 |
42 // 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 |
43 // top of the timeout for the transport socket. | 39 // top of the timeout for the transport socket. |
44 static const int kSOCKSConnectJobTimeoutInSeconds = 30; | 40 static const int kSOCKSConnectJobTimeoutInSeconds = 30; |
45 | 41 |
46 SOCKSConnectJob::SOCKSConnectJob( | 42 SOCKSConnectJob::SOCKSConnectJob( |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 | 277 |
282 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { | 278 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { |
283 return base_.ConnectionTimeout(); | 279 return base_.ConnectionTimeout(); |
284 } | 280 } |
285 | 281 |
286 ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const { | 282 ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const { |
287 return base_.histograms(); | 283 return base_.histograms(); |
288 }; | 284 }; |
289 | 285 |
290 } // namespace net | 286 } // namespace net |
OLD | NEW |