OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_PROXY_MOJO_PROXY_RESOLVER_V8_TRACING_BINDINGS_H_ | 5 #ifndef NET_PROXY_MOJO_PROXY_RESOLVER_V8_TRACING_BINDINGS_H_ |
6 #define NET_PROXY_MOJO_PROXY_RESOLVER_V8_TRACING_BINDINGS_H_ | 6 #define NET_PROXY_MOJO_PROXY_RESOLVER_V8_TRACING_BINDINGS_H_ |
7 | 7 |
| 8 #include <utility> |
| 9 |
8 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
9 #include "mojo/common/common_type_converters.h" | 11 #include "mojo/common/common_type_converters.h" |
10 #include "net/dns/host_resolver_mojo.h" | 12 #include "net/dns/host_resolver_mojo.h" |
11 #include "net/interfaces/proxy_resolver_service.mojom.h" | 13 #include "net/interfaces/proxy_resolver_service.mojom.h" |
12 #include "net/proxy/proxy_resolver_v8_tracing.h" | 14 #include "net/proxy/proxy_resolver_v8_tracing.h" |
13 | 15 |
14 namespace net { | 16 namespace net { |
15 | 17 |
16 // An implementation of ProxyResolverV8Tracing::Bindings that forwards requests | 18 // An implementation of ProxyResolverV8Tracing::Bindings that forwards requests |
17 // onto a Client mojo interface. Alert() and OnError() may be called from any | 19 // onto a Client mojo interface. Alert() and OnError() may be called from any |
(...skipping 29 matching lines...) Expand all Loading... |
47 BoundNetLog GetBoundNetLog() override { | 49 BoundNetLog GetBoundNetLog() override { |
48 DCHECK(thread_checker_.CalledOnValidThread()); | 50 DCHECK(thread_checker_.CalledOnValidThread()); |
49 return BoundNetLog(); | 51 return BoundNetLog(); |
50 } | 52 } |
51 | 53 |
52 private: | 54 private: |
53 // HostResolverMojo::Impl override. | 55 // HostResolverMojo::Impl override. |
54 void ResolveDns(interfaces::HostResolverRequestInfoPtr request_info, | 56 void ResolveDns(interfaces::HostResolverRequestInfoPtr request_info, |
55 interfaces::HostResolverRequestClientPtr client) { | 57 interfaces::HostResolverRequestClientPtr client) { |
56 DCHECK(thread_checker_.CalledOnValidThread()); | 58 DCHECK(thread_checker_.CalledOnValidThread()); |
57 client_->ResolveDns(request_info.Pass(), client.Pass()); | 59 client_->ResolveDns(std::move(request_info), std::move(client)); |
58 } | 60 } |
59 | 61 |
60 base::ThreadChecker thread_checker_; | 62 base::ThreadChecker thread_checker_; |
61 Client* client_; | 63 Client* client_; |
62 HostResolverMojo host_resolver_; | 64 HostResolverMojo host_resolver_; |
63 }; | 65 }; |
64 | 66 |
65 } // namespace net | 67 } // namespace net |
66 | 68 |
67 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_V8_TRACING_BINDINGS_H_ | 69 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_V8_TRACING_BINDINGS_H_ |
OLD | NEW |