Remove the "alternate_url" outparam from
[chromium-blink-merge.git] / net / dns / mojo_host_resolver_impl.h
blobaa359ef3e04b5166da5070ba6d168b43e0fba5a4
1 // Copyright 2015 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.
5 #ifndef NET_DNS_MOJO_HOST_RESOLVER_IMPL_H_
6 #define NET_DNS_MOJO_HOST_RESOLVER_IMPL_H_
8 #include <set>
10 #include "base/macros.h"
11 #include "base/threading/thread_checker.h"
12 #include "net/interfaces/host_resolver_service.mojom.h"
14 namespace net {
16 class HostResolver;
18 // This is the implementation of the HostResolver Mojo interface.
19 // Inbound Mojo requests are sent to the HostResolver passed into the
20 // constructor. When destroyed, any outstanding resolver requests are cancelled.
21 // If a request's HostResolverRequestClient is shut down, the associated
22 // resolver request is cancelled.
23 class MojoHostResolverImpl : public interfaces::HostResolver {
24 public:
25 // |resolver| is expected to outlive |this|.
26 explicit MojoHostResolverImpl(net::HostResolver* resolver);
27 ~MojoHostResolverImpl() override;
29 private:
30 class Job;
32 // Removes |job| from the set of pending jobs, and deletes it.
33 void DeleteJob(Job* job);
35 // Overridden from net::interfaces::HostResolver:
36 void Resolve(interfaces::HostResolverRequestInfoPtr request_info,
37 interfaces::HostResolverRequestClientPtr client) override;
39 // Resolver for resolving incoming requests. Not owned.
40 net::HostResolver* resolver_;
42 // All pending jobs, so they can be cancelled when this service is destroyed.
43 // Owns all jobs.
44 std::set<Job*> pending_jobs_;
46 base::ThreadChecker thread_checker_;
48 DISALLOW_COPY_AND_ASSIGN(MojoHostResolverImpl);
51 } // namespace net
53 #endif // NET_DNS_MOJO_HOST_RESOLVER_IMPL_H_