Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: net/dns/host_resolver_mojo.h

Issue 904313003: Implement utility-side host resolver Mojo client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-proxy-resolver
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/BUILD.gn ('k') | net/dns/host_resolver_mojo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef NET_DNS_HOST_RESOLVER_MOJO_H_
6 #define NET_DNS_HOST_RESOLVER_MOJO_H_
7
8 #include "base/callback.h"
9 #include "base/threading/thread_checker.h"
10 #include "net/dns/host_resolver.h"
11 #include "net/interfaces/host_resolver_service.mojom.h"
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h"
13
14 namespace net {
15 class AddressList;
16 class BoundNetLog;
17
18 // A HostResolver implementation that delegates to an interfaces::HostResolver
19 // mojo interface.
20 class HostResolverMojo : public HostResolver, public mojo::ErrorHandler {
21 public:
22 HostResolverMojo(interfaces::HostResolverPtr resolver,
23 const base::Closure& disconnect_callback);
24 ~HostResolverMojo() override;
25
26 // HostResolver overrides.
27 int Resolve(const RequestInfo& info,
28 RequestPriority priority,
29 AddressList* addresses,
30 const CompletionCallback& callback,
31 RequestHandle* request_handle,
32 const BoundNetLog& source_net_log) override;
33 int ResolveFromCache(const RequestInfo& info,
34 AddressList* addresses,
35 const BoundNetLog& source_net_log) override;
36 void CancelRequest(RequestHandle req) override;
37
38 private:
39 class Job;
40
41 // mojo::ErrorHandler override.
42 void OnConnectionError() override;
43
44 interfaces::HostResolverPtr resolver_;
45
46 const base::Closure disconnect_callback_;
47
48 base::ThreadChecker thread_checker_;
49
50 DISALLOW_COPY_AND_ASSIGN(HostResolverMojo);
51 };
52
53 } // namespace net
54
55 #endif // NET_DNS_HOST_RESOLVER_MOJO_H_
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | net/dns/host_resolver_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698