OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_DNS_HOST_RESOLVER_MOJO_HOST_H_ |
| 6 #define NET_DNS_HOST_RESOLVER_MOJO_HOST_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/threading/non_thread_safe.h" |
| 16 #include "base/time/time.h" |
| 17 #include "net/base/net_export.h" |
| 18 #include "net/base/network_change_notifier.h" |
| 19 #include "net/dns/host_cache.h" |
| 20 #include "net/dns/host_resolver.h" |
| 21 #include "net/dns/host_resolver.mojom.h" |
| 22 |
| 23 namespace net { |
| 24 |
| 25 class BoundNetLog; |
| 26 class DnsClient; |
| 27 class NetLog; |
| 28 |
| 29 class NET_EXPORT_PRIVATE HostResolverMojoHost |
| 30 : public mojo::InterfaceImpl<dns::Resolver>, |
| 31 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 32 public: |
| 33 explicit HostResolverMojoHost(HostResolver* resolver); |
| 34 void Resolve(dns::RequestInfoPtr request_info, |
| 35 dns::ResolveRequestClientPtr client) override; |
| 36 |
| 37 private: |
| 38 class Job; |
| 39 |
| 40 HostResolver* resolver_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(HostResolverMojoHost); |
| 43 }; |
| 44 |
| 45 } // namespace net |
| 46 |
| 47 namespace mojo { |
| 48 |
| 49 template <> |
| 50 struct TypeConverter<net::HostResolver::RequestInfo, net::dns::RequestInfo> { |
| 51 static net::HostResolver::RequestInfo Convert( |
| 52 const net::dns::RequestInfo& obj); |
| 53 }; |
| 54 |
| 55 template <> |
| 56 struct TypeConverter<net::dns::AddressListPtr, net::AddressList> { |
| 57 static net::dns::AddressListPtr Convert(const net::AddressList& obj); |
| 58 }; |
| 59 |
| 60 } // namespace mojo |
| 61 |
| 62 #endif // NET_DNS_HOST_RESOLVER_MOJO_HOST_H_ |
OLD | NEW |