OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_runner.h" | 5 #include "chrome/browser/net/dns_probe_runner.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 #include "net/base/address_list.h" | 11 #include "net/base/address_list.h" |
12 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 #include "net/base/network_change_notifier.h" | 14 #include "net/base/network_change_notifier.h" |
15 #include "net/dns/dns_client.h" | 15 #include "net/dns/dns_client.h" |
16 #include "net/dns/dns_protocol.h" | 16 #include "net/dns/dns_protocol.h" |
17 #include "net/dns/dns_response.h" | 17 #include "net/dns/dns_response.h" |
18 #include "net/dns/dns_transaction.h" | 18 #include "net/dns/dns_transaction.h" |
19 #include "net/log/net_log.h" | 19 #include "net/log/net_log_with_source.h" |
20 | 20 |
21 using base::TimeDelta; | 21 using base::TimeDelta; |
22 using content::BrowserThread; | 22 using content::BrowserThread; |
23 using net::AddressList; | 23 using net::AddressList; |
24 using net::DnsClient; | 24 using net::DnsClient; |
25 using net::DnsResponse; | 25 using net::DnsResponse; |
26 using net::DnsTransaction; | 26 using net::DnsTransaction; |
27 using net::DnsTransactionFactory; | 27 using net::DnsTransactionFactory; |
28 using net::IPEndPoint; | 28 using net::IPEndPoint; |
29 using net::NetLog; | |
30 using net::NetLogWithSource; | 29 using net::NetLogWithSource; |
31 using net::NetworkChangeNotifier; | 30 using net::NetworkChangeNotifier; |
32 | 31 |
33 namespace chrome_browser_net { | 32 namespace chrome_browser_net { |
34 | 33 |
35 const char DnsProbeRunner::kKnownGoodHostname[] = "google.com"; | 34 const char DnsProbeRunner::kKnownGoodHostname[] = "google.com"; |
36 | 35 |
37 namespace { | 36 namespace { |
38 | 37 |
39 DnsProbeRunner::Result EvaluateResponse( | 38 DnsProbeRunner::Result EvaluateResponse( |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 DCHECK(!callback_.is_null()); | 140 DCHECK(!callback_.is_null()); |
142 DCHECK(!transaction_.get()); | 141 DCHECK(!transaction_.get()); |
143 | 142 |
144 // Clear callback in case it starts a new probe immediately. | 143 // Clear callback in case it starts a new probe immediately. |
145 const base::Closure callback = callback_; | 144 const base::Closure callback = callback_; |
146 callback_.Reset(); | 145 callback_.Reset(); |
147 callback.Run(); | 146 callback.Run(); |
148 } | 147 } |
149 | 148 |
150 } // namespace chrome_browser_net | 149 } // namespace chrome_browser_net |
OLD | NEW |