| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // A DnsHostInfo object is used to store status of a Dns lookup of a specific | 5 // A DnsHostInfo object is used to store status of a Dns lookup of a specific |
| 6 // hostname. | 6 // hostname. |
| 7 // It includes progress, from placement in the DnsMaster's queue, to resolution | 7 // It includes progress, from placement in the DnsMaster's queue, to resolution |
| 8 // by the DNS service as either FOUND or NO_SUCH_NAME. | 8 // by the DNS service as either FOUND or NO_SUCH_NAME. |
| 9 | 9 |
| 10 #ifndef CHROME_BROWSER_NET_DNS_HOST_INFO_H_ | 10 #ifndef CHROME_BROWSER_NET_DNS_HOST_INFO_H_ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 static const base::TimeDelta kNullDuration; | 71 static const base::TimeDelta kNullDuration; |
| 72 | 72 |
| 73 // DnsHostInfo are usually made by the default constructor during | 73 // DnsHostInfo are usually made by the default constructor during |
| 74 // initializing of the DnsMaster's map (of info for Hostnames). | 74 // initializing of the DnsMaster's map (of info for Hostnames). |
| 75 DnsHostInfo() | 75 DnsHostInfo() |
| 76 : state_(PENDING), | 76 : state_(PENDING), |
| 77 resolve_duration_(kNullDuration), | 77 resolve_duration_(kNullDuration), |
| 78 queue_duration_(kNullDuration), | 78 queue_duration_(kNullDuration), |
| 79 benefits_remaining_(), | 79 benefits_remaining_(), |
| 80 sequence_number_(0), | 80 sequence_number_(0), |
| 81 motivation_(NO_PREFETCH_MOTIVATION), |
| 81 was_linked_(false) { | 82 was_linked_(false) { |
| 82 } | 83 } |
| 83 | 84 |
| 84 ~DnsHostInfo() {} | 85 ~DnsHostInfo() {} |
| 85 | 86 |
| 86 // NeedDnsUpdate decides, based on our internal info, | 87 // NeedDnsUpdate decides, based on our internal info, |
| 87 // if it would be valuable to attempt to update (prefectch) | 88 // if it would be valuable to attempt to update (prefectch) |
| 88 // DNS data for hostname. This decision is based | 89 // DNS data for hostname. This decision is based |
| 89 // on how recently we've done DNS prefetching for hostname. | 90 // on how recently we've done DNS prefetching for hostname. |
| 90 bool NeedsDnsUpdate(const std::string& hostname); | 91 bool NeedsDnsUpdate(const std::string& hostname); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 std::string referring_hostname_; | 184 std::string referring_hostname_; |
| 184 | 185 |
| 185 // We put these objects into a std::map, and hence we | 186 // We put these objects into a std::map, and hence we |
| 186 // need some "evil" constructors. | 187 // need some "evil" constructors. |
| 187 // DISALLOW_COPY_AND_ASSIGN(DnsHostInfo); | 188 // DISALLOW_COPY_AND_ASSIGN(DnsHostInfo); |
| 188 }; | 189 }; |
| 189 | 190 |
| 190 } // namespace chrome_browser_net | 191 } // namespace chrome_browser_net |
| 191 | 192 |
| 192 #endif // CHROME_BROWSER_NET_DNS_HOST_INFO_H_ | 193 #endif // CHROME_BROWSER_NET_DNS_HOST_INFO_H_ |
| OLD | NEW |