| 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_FACTORY_IMPL_H_ | 5 #ifndef NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_IMPL_H_ |
| 6 #define NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_IMPL_H_ | 6 #define NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | |
| 13 #include "net/interfaces/proxy_resolver_service.mojom.h" | 12 #include "net/interfaces/proxy_resolver_service.mojom.h" |
| 14 | 13 |
| 15 namespace net { | 14 namespace net { |
| 16 class HostResolver; | 15 class HostResolver; |
| 17 class ProxyResolverErrorObserver; | 16 class ProxyResolverErrorObserver; |
| 18 class ProxyResolverV8TracingFactory; | 17 class ProxyResolverV8TracingFactory; |
| 19 | 18 |
| 20 class MojoProxyResolverFactoryImpl : public interfaces::ProxyResolverFactory { | 19 class MojoProxyResolverFactoryImpl : public interfaces::ProxyResolverFactory { |
| 21 public: | 20 public: |
| 21 MojoProxyResolverFactoryImpl(); |
| 22 explicit MojoProxyResolverFactoryImpl( | 22 explicit MojoProxyResolverFactoryImpl( |
| 23 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request); | 23 std::unique_ptr<ProxyResolverV8TracingFactory> proxy_resolver_factory); |
| 24 MojoProxyResolverFactoryImpl( | |
| 25 std::unique_ptr<ProxyResolverV8TracingFactory> proxy_resolver_factory, | |
| 26 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request); | |
| 27 | 24 |
| 28 ~MojoProxyResolverFactoryImpl() override; | 25 ~MojoProxyResolverFactoryImpl() override; |
| 29 | 26 |
| 30 private: | 27 private: |
| 31 class Job; | 28 class Job; |
| 32 | 29 |
| 33 // interfaces::ProxyResolverFactory override. | 30 // interfaces::ProxyResolverFactory override. |
| 34 void CreateResolver( | 31 void CreateResolver( |
| 35 const mojo::String& pac_script, | 32 const mojo::String& pac_script, |
| 36 mojo::InterfaceRequest<interfaces::ProxyResolver> request, | 33 interfaces::ProxyResolverRequest request, |
| 37 interfaces::ProxyResolverFactoryRequestClientPtr client) override; | 34 interfaces::ProxyResolverFactoryRequestClientPtr client) override; |
| 38 | 35 |
| 39 void RemoveJob(Job* job); | 36 void RemoveJob(Job* job); |
| 40 | 37 |
| 41 const std::unique_ptr<ProxyResolverV8TracingFactory> | 38 const std::unique_ptr<ProxyResolverV8TracingFactory> |
| 42 proxy_resolver_impl_factory_; | 39 proxy_resolver_impl_factory_; |
| 43 mojo::StrongBinding<interfaces::ProxyResolverFactory> binding_; | |
| 44 | 40 |
| 45 std::set<Job*> jobs_; | 41 std::set<Job*> jobs_; |
| 46 | 42 |
| 47 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverFactoryImpl); | 43 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverFactoryImpl); |
| 48 }; | 44 }; |
| 49 | 45 |
| 50 } // namespace net | 46 } // namespace net |
| 51 | 47 |
| 52 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_IMPL_H_ | 48 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_IMPL_H_ |
| OLD | NEW |