| 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 "chrome/browser/net/dns_probe_service.h" | 5 #include "chrome/browser/net/dns_probe_service.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "net/base/ip_address.h" | 14 #include "net/base/ip_address.h" |
| 15 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 16 #include "net/dns/dns_client.h" | 16 #include "net/dns/dns_client.h" |
| 17 #include "net/dns/dns_config_service.h" | 17 #include "net/dns/dns_config_service.h" |
| 18 #include "net/dns/dns_protocol.h" | 18 #include "net/dns/dns_protocol.h" |
| 19 | 19 |
| 20 using base::FieldTrialList; | 20 using base::FieldTrialList; |
| 21 using base::StringToInt; | 21 using base::StringToInt; |
| 22 using error_page::DnsProbeStatus; | 22 using error_page::DnsProbeStatus; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 bool DnsProbeService::CachedResultIsExpired() const { | 217 bool DnsProbeService::CachedResultIsExpired() const { |
| 218 if (state_ != STATE_RESULT_CACHED) | 218 if (state_ != STATE_RESULT_CACHED) |
| 219 return false; | 219 return false; |
| 220 | 220 |
| 221 const base::TimeDelta kMaxResultAge = | 221 const base::TimeDelta kMaxResultAge = |
| 222 base::TimeDelta::FromMilliseconds(kMaxResultAgeMs); | 222 base::TimeDelta::FromMilliseconds(kMaxResultAgeMs); |
| 223 return base::Time::Now() - probe_start_time_ > kMaxResultAge; | 223 return base::Time::Now() - probe_start_time_ > kMaxResultAge; |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace chrome_browser_net | 226 } // namespace chrome_browser_net |
| OLD | NEW |