Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Unified Diff: net/proxy/proxy_resolver_mojo.h

Issue 1076083002: Shut down proxy resolver utility processes when no longer needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy-service-with-factory-restart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/mojo_proxy_resolver_factory.h ('k') | net/proxy/proxy_resolver_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_mojo.h
diff --git a/net/proxy/proxy_resolver_mojo.h b/net/proxy/proxy_resolver_mojo.h
index 134cbea298a451f936becce6c9a1ae55f767b6c1..ada43527f4f5bdc20cf317f4638a4d2ee233b689 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/threading/thread_checker.h"
@@ -31,17 +32,23 @@ 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.
+ // 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);
+ 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:
@@ -76,6 +83,8 @@ class ProxyResolverMojo : public ProxyResolver, public mojo::ErrorHandler {
base::ThreadChecker thread_checker_;
+ scoped_ptr<base::ScopedClosureRunner> on_delete_callback_runner_;
+
DISALLOW_COPY_AND_ASSIGN(ProxyResolverMojo);
};
@@ -83,8 +92,9 @@ class ProxyResolverMojo : public ProxyResolver, public mojo::ErrorHandler {
// create implementations of a Mojo proxy resolver to back a ProxyResolverMojo.
class ProxyResolverFactoryMojo : public ProxyResolverFactory {
public:
- ProxyResolverFactoryMojo(interfaces::ProxyResolverFactory* mojo_proxy_factory,
+ ProxyResolverFactoryMojo(MojoProxyResolverFactory* mojo_proxy_factory,
HostResolver* host_resolver);
+ ~ProxyResolverFactoryMojo() override;
// ProxyResolverFactory override.
int CreateProxyResolver(
@@ -96,7 +106,7 @@ class ProxyResolverFactoryMojo : public ProxyResolverFactory {
private:
class Job;
- interfaces::ProxyResolverFactory* const mojo_proxy_factory_;
+ MojoProxyResolverFactory* const mojo_proxy_factory_;
HostResolver* const host_resolver_;
DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactoryMojo);
« no previous file with comments | « net/proxy/mojo_proxy_resolver_factory.h ('k') | net/proxy/proxy_resolver_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698