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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 using net::DnsTransaction; | 26 using net::DnsTransaction; |
27 using net::DnsTransactionFactory; | 27 using net::DnsTransactionFactory; |
28 using net::IPAddressNumber; | 28 using net::IPAddressNumber; |
29 using net::IPEndPoint; | 29 using net::IPEndPoint; |
30 using net::NetLog; | 30 using net::NetLog; |
31 using net::NetworkChangeNotifier; | 31 using net::NetworkChangeNotifier; |
32 using net::ParseIPLiteralToNumber; | 32 using net::ParseIPLiteralToNumber; |
33 | 33 |
34 namespace chrome_browser_net { | 34 namespace chrome_browser_net { |
35 | 35 |
36 const char* DnsProbeRunner::kKnownGoodHostname = "google.com"; | 36 const char DnsProbeRunner::kKnownGoodHostname[] = "google.com"; |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 DnsProbeRunner::Result EvaluateResponse( | 40 DnsProbeRunner::Result EvaluateResponse( |
41 int net_error, | 41 int net_error, |
42 const DnsResponse* response) { | 42 const DnsResponse* response) { |
43 switch (net_error) { | 43 switch (net_error) { |
44 case net::OK: | 44 case net::OK: |
45 break; | 45 break; |
46 | 46 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 DCHECK(!callback_.is_null()); | 143 DCHECK(!callback_.is_null()); |
144 DCHECK(!transaction_.get()); | 144 DCHECK(!transaction_.get()); |
145 | 145 |
146 // Clear callback in case it starts a new probe immediately. | 146 // Clear callback in case it starts a new probe immediately. |
147 const base::Closure callback = callback_; | 147 const base::Closure callback = callback_; |
148 callback_.Reset(); | 148 callback_.Reset(); |
149 callback.Run(); | 149 callback.Run(); |
150 } | 150 } |
151 | 151 |
152 } // namespace chrome_browser_net | 152 } // namespace chrome_browser_net |
OLD | NEW |