Index: net/dns/host_resolver_mojo.h |
diff --git a/net/dns/host_resolver_mojo.h b/net/dns/host_resolver_mojo.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..22c7805e9087aaa2fda73877937d2f3afc9deead |
--- /dev/null |
+++ b/net/dns/host_resolver_mojo.h |
@@ -0,0 +1,72 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef NET_DNS_HOST_RESOLVER_MOJO_H_ |
+#define NET_DNS_HOST_RESOLVER_MOJO_H_ |
+ |
+#include <map> |
+ |
+#include "base/basictypes.h" |
+#include "base/gtest_prod_util.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/memory/scoped_vector.h" |
+#include "base/memory/weak_ptr.h" |
+#include "base/threading/non_thread_safe.h" |
+#include "base/time/time.h" |
+#include "net/base/net_export.h" |
+#include "net/base/network_change_notifier.h" |
+#include "net/dns/host_cache.h" |
+#include "net/dns/host_resolver.h" |
+#include "net/dns/host_resolver.mojom.h" |
+ |
+namespace net { |
+ |
+class BoundNetLog; |
+class DnsClient; |
+class NetLog; |
+ |
+class NET_EXPORT HostResolverMojo |
+ : public HostResolver, |
+ NON_EXPORTED_BASE(public base::NonThreadSafe) { |
+ public: |
+ explicit HostResolverMojo(dns::ResolverPtr resolver); |
+ ~HostResolverMojo(); |
+ |
+ int Resolve(const RequestInfo& info, |
+ RequestPriority priority, |
+ AddressList* addresses, |
+ const CompletionCallback& callback, |
+ RequestHandle* out_req, |
+ const BoundNetLog& source_net_log) override; |
+ int ResolveFromCache(const RequestInfo& info, |
+ AddressList* addresses, |
+ const BoundNetLog& source_net_log) override; |
+ void CancelRequest(RequestHandle req) override; |
+ |
+ private: |
+ class Job; |
+ |
+ dns::ResolverPtr resolver_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(HostResolverMojo); |
+}; |
+ |
+} // namespace net |
+ |
+namespace mojo { |
+ |
+template <> |
+struct TypeConverter<net::dns::RequestInfoPtr, net::HostResolver::RequestInfo> { |
+ static net::dns::RequestInfoPtr Convert( |
+ const net::HostResolver::RequestInfo& obj); |
+}; |
+ |
+template <> |
+struct TypeConverter<net::AddressList, net::dns::AddressList> { |
+ static net::AddressList Convert(const net::dns::AddressList& obj); |
+}; |
+ |
+} // namespace mojo |
+ |
+#endif // NET_DNS_HOST_RESOLVER_MOJO_H_ |