| 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_H_ | 5 #ifndef NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_H_ |
| 6 #define NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_H_ | 6 #define NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| 11 #include "mojo/public/cpp/bindings/interface_request.h" | 11 #include "mojo/public/cpp/bindings/interface_request.h" |
| 12 #include "net/interfaces/host_resolver_service.mojom.h" | 12 #include "net/interfaces/host_resolver_service.mojom.h" |
| 13 #include "net/interfaces/proxy_resolver_service.mojom.h" | 13 #include "net/interfaces/proxy_resolver_service.mojom.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 // Factory for connecting to Mojo ProxyResolver services. | 17 // Factory for connecting to Mojo ProxyResolver services. |
| 18 class MojoProxyResolverFactory { | 18 class MojoProxyResolverFactory { |
| 19 public: | 19 public: |
| 20 // Connect to a new ProxyResolver service using request |req|, using | 20 // Connect to a new ProxyResolver service using request |req|, using |
| 21 // |host_resolver| as the DNS resolver. The return value should be released | 21 // |host_resolver| as the DNS resolver. The return value should be released |
| 22 // when the connection to |req| is no longer needed. | 22 // when the connection to |req| is no longer needed. |
| 23 // Note: The connection request |req| may be resolved asynchronously. | 23 // Note: The connection request |req| may be resolved asynchronously. |
| 24 virtual std::unique_ptr<base::ScopedClosureRunner> CreateResolver( | 24 virtual std::unique_ptr<base::ScopedClosureRunner> CreateResolver( |
| 25 const mojo::String& pac_script, | 25 const std::string& pac_script, |
| 26 mojo::InterfaceRequest<interfaces::ProxyResolver> req, | 26 mojo::InterfaceRequest<interfaces::ProxyResolver> req, |
| 27 interfaces::ProxyResolverFactoryRequestClientPtr client) = 0; | 27 interfaces::ProxyResolverFactoryRequestClientPtr client) = 0; |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 virtual ~MojoProxyResolverFactory() = default; | 30 virtual ~MojoProxyResolverFactory() = default; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace net | 33 } // namespace net |
| 34 | 34 |
| 35 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_H_ | 35 #endif // NET_PROXY_MOJO_PROXY_RESOLVER_FACTORY_H_ |
| OLD | NEW |