| // Copyright 2015 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 MOJO_SERVICES_NETWORK_HOST_RESOLVER_IMPL_H_ |
| #define MOJO_SERVICES_NETWORK_HOST_RESOLVER_IMPL_H_ |
| |
| #include "base/memory/scoped_ptr.h" |
| #include "base/threading/thread_checker.h" |
| #include "mojo/services/network/interfaces/host_resolver.mojom.h" |
| #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
| |
| namespace net { |
| class HostResolver; |
| } |
| |
| namespace mojo { |
| |
| // This is an implementation of the HostResolver Mojo interface. |
| class HostResolverImpl : public HostResolver { |
| public: |
| explicit HostResolverImpl(InterfaceRequest<HostResolver> request); |
| ~HostResolverImpl() override; |
| |
| void GetHostAddresses(const mojo::String& host, |
| NetAddressFamily family, |
| const GetHostAddressesCallback& callback) override; |
| |
| private: |
| StrongBinding<HostResolver> binding_; |
| scoped_ptr<net::HostResolver> resolver_; |
| base::ThreadChecker thread_checker_; |
| |
| DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); |
| }; |
| |
| } // namespace mojo |
| |
| #endif // MOJO_SERVICES_NETWORK_HOST_RESOLVER_IMPL_H_ |