| Index: net/proxy/proxy_resolver_mojo.h
|
| diff --git a/net/proxy/proxy_resolver_mojo.h b/net/proxy/proxy_resolver_mojo.h
|
| index ada43527f4f5bdc20cf317f4638a4d2ee233b689..7c8274624093b26a8841d44724d930f3b873189f 100644
|
| --- a/net/proxy/proxy_resolver_mojo.h
|
| +++ b/net/proxy/proxy_resolver_mojo.h
|
| @@ -5,95 +5,27 @@
|
| #ifndef NET_PROXY_PROXY_RESOLVER_MOJO_H_
|
| #define NET_PROXY_PROXY_RESOLVER_MOJO_H_
|
|
|
| -#include <set>
|
| -
|
| -#include "base/callback_helpers.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "base/threading/thread_checker.h"
|
| #include "net/base/completion_callback.h"
|
| -#include "net/base/load_states.h"
|
| -#include "net/interfaces/host_resolver_service.mojom.h"
|
| -#include "net/interfaces/proxy_resolver_service.mojom.h"
|
| -#include "net/proxy/proxy_resolver.h"
|
| #include "net/proxy/proxy_resolver_factory.h"
|
| -#include "net/proxy/proxy_resolver_script_data.h"
|
| #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
|
|
|
| -class GURL;
|
| -
|
| namespace net {
|
| -
|
| -class BoundNetLog;
|
| class HostResolver;
|
| -class ProxyInfo;
|
| +class ProxyResolverErrorObserver;
|
| +class ProxyResolverScriptData;
|
| class MojoProxyResolverFactory;
|
|
|
| -// Implementation of ProxyResolver that connects to a Mojo service to evaluate
|
| -// PAC scripts. This implementation only knows about Mojo services, and
|
| -// therefore that service may live in or out of process.
|
| -//
|
| -// This implementation reports disconnections from the Mojo service (i.e. if the
|
| -// service is out-of-process and that process crashes) using the error code
|
| -// ERR_PAC_SCRIPT_TERMINATED.
|
| -class ProxyResolverMojo : public ProxyResolver, public mojo::ErrorHandler {
|
| - public:
|
| - // Constructs a ProxyResolverMojo that connects to a mojo proxy resolver
|
| - // implementation using |resolver_ptr|. The implementation uses
|
| - // |host_resolver| as the DNS resolver, using |host_resolver_binding| to
|
| - // communicate with it. When deleted, the closure contained within
|
| - // |on_delete_callback_runner| will be run.
|
| - // TODO(amistry): Add ProxyResolverErrorObserver and NetLog.
|
| - ProxyResolverMojo(
|
| - interfaces::ProxyResolverPtr resolver_ptr,
|
| - scoped_ptr<interfaces::HostResolver> host_resolver,
|
| - scoped_ptr<mojo::Binding<interfaces::HostResolver>> host_resolver_binding,
|
| - scoped_ptr<base::ScopedClosureRunner> on_delete_callback_runner);
|
| - ~ProxyResolverMojo() override;
|
| -
|
| - // ProxyResolver implementation:
|
| - int GetProxyForURL(const GURL& url,
|
| - ProxyInfo* results,
|
| - const net::CompletionCallback& callback,
|
| - RequestHandle* request,
|
| - const BoundNetLog& net_log) override;
|
| - void CancelRequest(RequestHandle request) override;
|
| - LoadState GetLoadState(RequestHandle request) const override;
|
| - void CancelSetPacScript() override;
|
| - int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& pac_script,
|
| - const net::CompletionCallback& callback) override;
|
| -
|
| - private:
|
| - class Job;
|
| -
|
| - // Overridden from mojo::ErrorHandler:
|
| - void OnConnectionError() override;
|
| -
|
| - void RemoveJob(Job* job);
|
| -
|
| - // Connection to the Mojo proxy resolver.
|
| - interfaces::ProxyResolverPtr mojo_proxy_resolver_ptr_;
|
| -
|
| - // Mojo host resolver service and binding.
|
| - scoped_ptr<interfaces::HostResolver> mojo_host_resolver_;
|
| - scoped_ptr<mojo::Binding<interfaces::HostResolver>>
|
| - mojo_host_resolver_binding_;
|
| -
|
| - std::set<Job*> pending_jobs_;
|
| -
|
| - base::ThreadChecker thread_checker_;
|
| -
|
| - scoped_ptr<base::ScopedClosureRunner> on_delete_callback_runner_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(ProxyResolverMojo);
|
| -};
|
| -
|
| // Implementation of ProxyResolverFactory that connects to a Mojo service to
|
| // create implementations of a Mojo proxy resolver to back a ProxyResolverMojo.
|
| class ProxyResolverFactoryMojo : public ProxyResolverFactory {
|
| public:
|
| - ProxyResolverFactoryMojo(MojoProxyResolverFactory* mojo_proxy_factory,
|
| - HostResolver* host_resolver);
|
| + ProxyResolverFactoryMojo(
|
| + MojoProxyResolverFactory* mojo_proxy_factory,
|
| + HostResolver* host_resolver,
|
| + const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()>&
|
| + error_observer_factory);
|
| ~ProxyResolverFactoryMojo() override;
|
|
|
| // ProxyResolverFactory override.
|
| @@ -108,6 +40,8 @@ class ProxyResolverFactoryMojo : public ProxyResolverFactory {
|
|
|
| MojoProxyResolverFactory* const mojo_proxy_factory_;
|
| HostResolver* const host_resolver_;
|
| + const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()>
|
| + error_observer_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactoryMojo);
|
| };
|
|
|