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

Unified Diff: net/proxy/in_process_mojo_proxy_resolver_factory.cc

Issue 910343003: Create an in-process v8 proxy resolver using Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-pac-complete-patch
Patch Set: Remove extra space. Created 5 years, 9 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/in_process_mojo_proxy_resolver_factory.h ('k') | net/proxy/mojo_proxy_resolver_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/in_process_mojo_proxy_resolver_factory.cc
diff --git a/net/proxy/in_process_mojo_proxy_resolver_factory.cc b/net/proxy/in_process_mojo_proxy_resolver_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da5f1138304cf80a97f5e97b69b1e953cc9ccb58
--- /dev/null
+++ b/net/proxy/in_process_mojo_proxy_resolver_factory.cc
@@ -0,0 +1,34 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/proxy/in_process_mojo_proxy_resolver_factory.h"
+
+#include "base/memory/singleton.h"
+#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
+
+namespace net {
+
+// static
+InProcessMojoProxyResolverFactory*
+InProcessMojoProxyResolverFactory::GetInstance() {
+ return Singleton<InProcessMojoProxyResolverFactory>::get();
+}
+
+InProcessMojoProxyResolverFactory::InProcessMojoProxyResolverFactory() {
+ // Implementation lifetime is strongly bound to the life of the connection via
+ // |factory_|. When |factory_| is destroyed, the Mojo connection is terminated
+ // which causes this object to be destroyed.
+ new MojoProxyResolverFactoryImpl(mojo::GetProxy(&factory_));
+}
+
+InProcessMojoProxyResolverFactory::~InProcessMojoProxyResolverFactory() =
+ default;
+
+void InProcessMojoProxyResolverFactory::Create(
+ mojo::InterfaceRequest<interfaces::ProxyResolver> req,
+ interfaces::HostResolverPtr host_resolver) {
+ factory_->CreateResolver(req.Pass(), host_resolver.Pass());
+}
+
+} // namespace net
« no previous file with comments | « net/proxy/in_process_mojo_proxy_resolver_factory.h ('k') | net/proxy/mojo_proxy_resolver_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698