Index: net/proxy/proxy_resolver_mojo.h |
diff --git a/net/proxy/proxy_resolver_mojo.h b/net/proxy/proxy_resolver_mojo.h |
index 6bc7d6bbfd28e3638249c8248accff15de0da765..5de984b32ecbcb4964d597ca9b1a8732d29a6a40 100644 |
--- a/net/proxy/proxy_resolver_mojo.h |
+++ b/net/proxy/proxy_resolver_mojo.h |
@@ -7,6 +7,7 @@ |
#include <set> |
+#include "base/callback_helpers.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
@@ -32,18 +33,16 @@ class MojoProxyResolverFactory; |
// PAC scripts. This implementation only knows about Mojo services, and |
// therefore that service may live in or out of process. |
// |
-// This implementation handles disconnections from the Mojo service (i.e. if the |
-// service is out-of-process and that process crashes) and transparently |
-// re-connects to a new service. |
+// 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 and connects to a new Mojo proxy resolver |
- // service using |mojo_proxy_resolver_factory|. The new Mojo proxy resolver |
- // uses |host_resolver| as the DNS resolver. |mojo_proxy_resolver_factory| |
- // and |host_resolver| are not owned and must outlive this. |
+ // Constructs a ProxyResolverMojo connected to a Mojo proxy resolver service |
+ // using |mojo_proxy_resolver| that will delete |runner| when it is deleted. |
eroman
2015/04/15 00:46:44
this comment is hard to parse
Sam McNally
2015/04/15 06:04:22
How about now?
|
// TODO(amistry): Add ProxyResolverErrorObserver and NetLog. |
- ProxyResolverMojo(MojoProxyResolverFactory* mojo_proxy_resolver_factory, |
- HostResolver* host_resolver); |
+ ProxyResolverMojo(interfaces::ProxyResolverPtr mojo_proxy_resolver, |
+ scoped_ptr<base::ScopedClosureRunner> runner); |
~ProxyResolverMojo() override; |
// ProxyResolver implementation: |
@@ -70,8 +69,6 @@ class ProxyResolverMojo : public ProxyResolver, public mojo::ErrorHandler { |
const net::CompletionCallback& callback, |
int32_t result); |
- void SetUpServices(); |
- |
void AbortPendingRequests(); |
void RemoveJob(Job* job); |
@@ -79,24 +76,13 @@ class ProxyResolverMojo : public ProxyResolver, public mojo::ErrorHandler { |
// 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_; |
- |
- // Factory for connecting to new Mojo proxy resolvers. |
- // Not owned. |
- MojoProxyResolverFactory* mojo_proxy_resolver_factory_; |
- |
- // DNS resolver, saved for creating a new Mojo proxy resolver when the |
- // existing one disconnects (i.e. when utility process crashes). |
- HostResolver* host_resolver_; |
- |
std::set<Job*> pending_jobs_; |
net::CancelableCompletionCallback set_pac_script_callback_; |
base::ThreadChecker thread_checker_; |
+ scoped_ptr<base::ScopedClosureRunner> runner_; |
+ |
base::WeakPtrFactory<ProxyResolverMojo> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(ProxyResolverMojo); |