| Index: chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h
|
| diff --git a/chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h b/chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h
|
| index da17a3cbd4b00223b546cfd0e45d22bb256213a8..2b796a2cfeab84f99f50c102449efa500df2168e 100644
|
| --- a/chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h
|
| +++ b/chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h
|
| @@ -6,7 +6,14 @@
|
| #define CHROME_BROWSER_NET_UTILITY_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_
|
|
|
| #include "base/macros.h"
|
| -#include "net/interfaces/proxy_resolver_service.mojom.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/threading/thread_checker.h"
|
| +#include "base/timer/timer.h"
|
| +#include "net/proxy/mojo_proxy_resolver_factory.h"
|
| +
|
| +namespace content {
|
| +class UtilityProcessHost;
|
| +}
|
|
|
| template <typename Type>
|
| struct DefaultSingletonTraits;
|
| @@ -16,13 +23,13 @@ struct DefaultSingletonTraits;
|
| // utility process. Utility process crashes are detected and the utility
|
| // process is automatically restarted.
|
| class UtilityProcessMojoProxyResolverFactory
|
| - : public net::interfaces::ProxyResolverFactory,
|
| + : public net::MojoProxyResolverFactory,
|
| public mojo::ErrorHandler {
|
| public:
|
| static UtilityProcessMojoProxyResolverFactory* GetInstance();
|
|
|
| - // Overridden from net::interfaces::ProxyResolverFactory:
|
| - void CreateResolver(
|
| + // Overridden from net::MojoProxyResolverFactory:
|
| + scoped_ptr<base::ScopedClosureRunner> CreateResolver(
|
| const mojo::String& pac_script,
|
| mojo::InterfaceRequest<net::interfaces::ProxyResolver> req,
|
| net::interfaces::HostResolverPtr host_resolver,
|
| @@ -36,12 +43,26 @@ class UtilityProcessMojoProxyResolverFactory
|
| // Overridden from mojo::ErrorHandler:
|
| void OnConnectionError() override;
|
|
|
| + // Invoked each time a proxy resolver is destroyed.
|
| + void OnResolverDestroyed();
|
| +
|
| + // Invoked once an idle timeout has elapsed after all proxy resolvers are
|
| + // destroyed.
|
| + void OnIdleTimeout();
|
| +
|
| // Creates a new utility process and connects to its Mojo proxy resolver
|
| // factory.
|
| void CreateProcessAndConnect();
|
|
|
| net::interfaces::ProxyResolverFactoryPtr resolver_factory_;
|
|
|
| + base::WeakPtr<content::UtilityProcessHost> weak_utility_process_host_;
|
| + size_t num_proxy_resolvers_ = 0;
|
| +
|
| + base::OneShotTimer<UtilityProcessMojoProxyResolverFactory> idle_timer_;
|
| +
|
| + base::ThreadChecker thread_checker_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(UtilityProcessMojoProxyResolverFactory);
|
| };
|
|
|
|
|