| 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/dns/dns_config_service.h" | 5 #include "net/dns/dns_config_service.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 // Default values are taken from glibc resolv.h. | 14 // Default values are taken from glibc resolv.h except timeout which is set to |
| 15 // |kDnsTimeoutSeconds|. |
| 15 DnsConfig::DnsConfig() | 16 DnsConfig::DnsConfig() |
| 16 : append_to_multi_label_name(true), | 17 : append_to_multi_label_name(true), |
| 17 ndots(1), | 18 ndots(1), |
| 18 timeout(base::TimeDelta::FromSeconds(5)), | 19 timeout(base::TimeDelta::FromSeconds(kDnsTimeoutSeconds)), |
| 19 attempts(2), | 20 attempts(2), |
| 20 rotate(false), | 21 rotate(false), |
| 21 edns0(false) {} | 22 edns0(false) {} |
| 22 | 23 |
| 23 DnsConfig::~DnsConfig() {} | 24 DnsConfig::~DnsConfig() {} |
| 24 | 25 |
| 25 bool DnsConfig::Equals(const DnsConfig& d) const { | 26 bool DnsConfig::Equals(const DnsConfig& d) const { |
| 26 return EqualsIgnoreHosts(d) && (hosts == d.hosts); | 27 return EqualsIgnoreHosts(d) && (hosts == d.hosts); |
| 27 } | 28 } |
| 28 | 29 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 timer_.Stop(); | 214 timer_.Stop(); |
| 214 if (!need_update_) | 215 if (!need_update_) |
| 215 return; | 216 return; |
| 216 need_update_ = false; | 217 need_update_ = false; |
| 217 last_sent_empty_ = false; | 218 last_sent_empty_ = false; |
| 218 callback_.Run(dns_config_); | 219 callback_.Run(dns_config_); |
| 219 } | 220 } |
| 220 | 221 |
| 221 } // namespace net | 222 } // namespace net |
| 222 | 223 |
| OLD | NEW |