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/transport_client_socket_pool.h" | 5 #include "net/socket/transport_client_socket_pool.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 RequestPriority priority, | 63 RequestPriority priority, |
64 const GURL& referrer, | 64 const GURL& referrer, |
65 bool disable_resolver_cache, | 65 bool disable_resolver_cache, |
66 bool ignore_limits) | 66 bool ignore_limits) |
67 : destination_(host_port_pair), ignore_limits_(ignore_limits) { | 67 : destination_(host_port_pair), ignore_limits_(ignore_limits) { |
68 Initialize(priority, referrer, disable_resolver_cache); | 68 Initialize(priority, referrer, disable_resolver_cache); |
69 } | 69 } |
70 | 70 |
71 TransportSocketParams::~TransportSocketParams() {} | 71 TransportSocketParams::~TransportSocketParams() {} |
72 | 72 |
| 73 // TODO(szym): remove unneeded referrer |
73 void TransportSocketParams::Initialize(RequestPriority priority, | 74 void TransportSocketParams::Initialize(RequestPriority priority, |
74 const GURL& referrer, | 75 const GURL& referrer, |
75 bool disable_resolver_cache) { | 76 bool disable_resolver_cache) { |
76 // The referrer is used by the DNS prefetch system to correlate resolutions | |
77 // with the page that triggered them. It doesn't impact the actual addresses | |
78 // that we resolve to. | |
79 destination_.set_referrer(referrer); | |
80 destination_.set_priority(priority); | 77 destination_.set_priority(priority); |
81 if (disable_resolver_cache) | 78 if (disable_resolver_cache) |
82 destination_.set_allow_cached_response(false); | 79 destination_.set_allow_cached_response(false); |
83 } | 80 } |
84 | 81 |
85 // TransportConnectJobs will time out after this many seconds. Note this is | 82 // TransportConnectJobs will time out after this many seconds. Note this is |
86 // the total time, including both host resolution and TCP connect() times. | 83 // the total time, including both host resolution and TCP connect() times. |
87 // | 84 // |
88 // TODO(eroman): The use of this constant needs to be re-evaluated. The time | 85 // TODO(eroman): The use of this constant needs to be re-evaluated. The time |
89 // needed for TCPClientSocketXXX::Connect() can be arbitrarily long, since | 86 // needed for TCPClientSocketXXX::Connect() can be arbitrarily long, since |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 478 |
482 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { | 479 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { |
483 return base_.ConnectionTimeout(); | 480 return base_.ConnectionTimeout(); |
484 } | 481 } |
485 | 482 |
486 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { | 483 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { |
487 return base_.histograms(); | 484 return base_.histograms(); |
488 } | 485 } |
489 | 486 |
490 } // namespace net | 487 } // namespace net |
OLD | NEW |