| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
| 12 #include "chrome/browser/io_thread.h" | 12 #include "chrome/browser/io_thread.h" |
| 13 #include "net/base/address_list.h" | 13 #include "net/base/address_list.h" |
| 14 #include "net/base/capturing_net_log.h" | 14 #include "net/base/capturing_net_log.h" |
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
| 16 #include "net/base/host_resolver.h" | 16 #include "net/base/host_resolver.h" |
| 17 | 17 |
| 18 class IOThread; | 18 class IOThread; |
| 19 | 19 |
| 20 namespace extensions { | 20 namespace extensions { |
| 21 | 21 |
| 22 class DNSResolveFunction : public AsyncExtensionFunction { | 22 class DnsResolveFunction : public AsyncExtensionFunction { |
| 23 public: | 23 public: |
| 24 DNSResolveFunction(); | 24 DnsResolveFunction(); |
| 25 virtual ~DNSResolveFunction(); | 25 virtual ~DnsResolveFunction(); |
| 26 | 26 |
| 27 virtual bool RunImpl() OVERRIDE; | 27 virtual bool RunImpl() OVERRIDE; |
| 28 | 28 |
| 29 // See below. Caller retains ownership. | 29 // See below. Caller retains ownership. |
| 30 static void set_host_resolver_for_testing( | 30 static void set_host_resolver_for_testing( |
| 31 net::HostResolver* host_resolver_for_testing); | 31 net::HostResolver* host_resolver_for_testing); |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 void WorkOnIOThread(); | 34 void WorkOnIOThread(); |
| 35 void RespondOnUIThread(); | 35 void RespondOnUIThread(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 54 scoped_ptr<net::AddressList> addresses_; | 54 scoped_ptr<net::AddressList> addresses_; |
| 55 | 55 |
| 56 void OnLookupFinished(int result); | 56 void OnLookupFinished(int result); |
| 57 | 57 |
| 58 DECLARE_EXTENSION_FUNCTION_NAME("experimental.dns.resolve") | 58 DECLARE_EXTENSION_FUNCTION_NAME("experimental.dns.resolve") |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace extensions | 61 } // namespace extensions |
| 62 | 62 |
| 63 #endif // CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ | 63 #endif // CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ |
| OLD | NEW |