| 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 "net/interfaces/proxy_resolver_service.mojom.h" | 11 #include "net/interfaces/proxy_resolver_service.mojom.h" |
| 12 #include "net/proxy/proxy_resolver.h" | 12 #include "net/proxy/proxy_resolver.h" |
| 13 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 13 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 class HostResolver; | 16 class HostResolver; |
| 17 class ProxyResolverErrorObserver; |
| 17 class ProxyResolverFactory; | 18 class ProxyResolverFactory; |
| 18 | 19 |
| 19 class MojoProxyResolverFactoryImpl : public interfaces::ProxyResolverFactory { | 20 class MojoProxyResolverFactoryImpl : public interfaces::ProxyResolverFactory { |
| 20 public: | 21 public: |
| 21 using Factory = base::Callback<scoped_ptr<net::ProxyResolverFactory>( | 22 using Factory = base::Callback<scoped_ptr<net::ProxyResolverFactory>( |
| 22 HostResolver*, | 23 HostResolver*, |
| 24 scoped_ptr<ProxyResolverErrorObserver>, |
| 23 const ProxyResolver::LoadStateChangedCallback&)>; | 25 const ProxyResolver::LoadStateChangedCallback&)>; |
| 24 | 26 |
| 25 explicit MojoProxyResolverFactoryImpl( | 27 explicit MojoProxyResolverFactoryImpl( |
| 26 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request); | 28 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request); |
| 27 MojoProxyResolverFactoryImpl( | 29 MojoProxyResolverFactoryImpl( |
| 28 const Factory& proxy_resolver_factory, | 30 const Factory& proxy_resolver_factory, |
| 29 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request); | 31 mojo::InterfaceRequest<interfaces::ProxyResolverFactory> request); |
| 30 | 32 |
| 31 ~MojoProxyResolverFactoryImpl() override; | 33 ~MojoProxyResolverFactoryImpl() override; |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 class Job; | 36 class Job; |
| 35 | 37 |
| 36 // interfaces::ProxyResolverFactory override. | 38 // interfaces::ProxyResolverFactory override. |
| 37 void CreateResolver( | 39 void CreateResolver( |
| 38 const mojo::String& pac_script, | 40 const mojo::String& pac_script, |
| 39 mojo::InterfaceRequest<interfaces::ProxyResolver> request, | 41 mojo::InterfaceRequest<interfaces::ProxyResolver> request, |
| 40 interfaces::HostResolverPtr host_resolver, | 42 interfaces::HostResolverPtr host_resolver, |
| 43 interfaces::ProxyResolverErrorObserverPtr error_observer, |
| 41 interfaces::ProxyResolverFactoryRequestClientPtr client) override; | 44 interfaces::ProxyResolverFactoryRequestClientPtr client) override; |
| 42 | 45 |
| 43 void RemoveJob(Job* job); | 46 void RemoveJob(Job* job); |
| 44 | 47 |
| 45 const Factory proxy_resolver_impl_factory_; | 48 const Factory proxy_resolver_impl_factory_; |
| 46 mojo::StrongBinding<interfaces::ProxyResolverFactory> binding_; | 49 mojo::StrongBinding<interfaces::ProxyResolverFactory> binding_; |
| 47 | 50 |
| 48 std::set<Job*> jobs_; | 51 std::set<Job*> jobs_; |
| 49 | 52 |
| 50 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverFactoryImpl); | 53 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverFactoryImpl); |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 } // namespace net | 56 } // namespace net |
| 54 | 57 |
| 55 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_IMPL_H_ | 58 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_IMPL_H_ |
| OLD | NEW |