| 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 #ifndef CHROME_BROWSER_NET_DNS_PROBE_RUNNER_H_ | 5 #ifndef CHROME_BROWSER_NET_DNS_PROBE_RUNNER_H_ |
| 6 #define CHROME_BROWSER_NET_DNS_PROBE_RUNNER_H_ | 6 #define CHROME_BROWSER_NET_DNS_PROBE_RUNNER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // Returns the result of the last probe. | 57 // Returns the result of the last probe. |
| 58 Result result() const { return result_; } | 58 Result result() const { return result_; } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 void OnTransactionComplete(net::DnsTransaction* transaction, | 61 void OnTransactionComplete(net::DnsTransaction* transaction, |
| 62 int net_error, | 62 int net_error, |
| 63 const net::DnsResponse* response); | 63 const net::DnsResponse* response); |
| 64 void CallCallback(); | 64 void CallCallback(); |
| 65 | 65 |
| 66 base::WeakPtrFactory<DnsProbeRunner> weak_factory_; | |
| 67 | |
| 68 scoped_ptr<net::DnsClient> client_; | 66 scoped_ptr<net::DnsClient> client_; |
| 69 | 67 |
| 70 // The callback passed to |RunProbe|. Cleared right before calling the | 68 // The callback passed to |RunProbe|. Cleared right before calling the |
| 71 // callback. | 69 // callback. |
| 72 base::Closure callback_; | 70 base::Closure callback_; |
| 73 | 71 |
| 74 // The transaction started in |RunProbe| for the DNS probe. Reset once the | 72 // The transaction started in |RunProbe| for the DNS probe. Reset once the |
| 75 // results have been examined. | 73 // results have been examined. |
| 76 scoped_ptr<net::DnsTransaction> transaction_; | 74 scoped_ptr<net::DnsTransaction> transaction_; |
| 77 | 75 |
| 78 Result result_; | 76 Result result_; |
| 79 | 77 |
| 78 base::WeakPtrFactory<DnsProbeRunner> weak_factory_; |
| 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(DnsProbeRunner); | 80 DISALLOW_COPY_AND_ASSIGN(DnsProbeRunner); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace chrome_browser_net | 83 } // namespace chrome_browser_net |
| 84 | 84 |
| 85 #endif // CHROME_BROWSER_NET_DNS_PROBE_RUNNER_H_ | 85 #endif // CHROME_BROWSER_NET_DNS_PROBE_RUNNER_H_ |
| OLD | NEW |