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

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: Flag. Created 5 years, 10 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
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..cc406e8eaadbb5e43a76242dd04890513b357067
--- /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() {
Sam McNally 2015/02/26 06:36:40 I prefer "= default" over {}
Anand Mistry (off Chromium) 2015/02/27 03:00:58 Done.
+}
+
+void InProcessMojoProxyResolverFactory::Create(
+ mojo::InterfaceRequest<interfaces::ProxyResolver> req,
+ interfaces::HostResolverPtr host_resolver) {
+ factory_->CreateResolver(req.Pass(), host_resolver.Pass());
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698