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

Unified Diff: net/proxy/test_mojo_proxy_resolver_factory.cc

Issue 2881613002: Allow use of Mojo/V8 ProxyResolvers with URLRequestContextBuilder. (Closed)
Patch Set: Forgot to remove WaitForConnectionsListener Created 3 years, 7 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/test_mojo_proxy_resolver_factory.cc
diff --git a/net/proxy/test_mojo_proxy_resolver_factory.cc b/net/proxy/test_mojo_proxy_resolver_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9a0223a2ef55d5bbc08f0818a472ef151e3ad63e
--- /dev/null
+++ b/net/proxy/test_mojo_proxy_resolver_factory.cc
@@ -0,0 +1,34 @@
+// Copyright 2017 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/test_mojo_proxy_resolver_factory.h"
+
+#include "base/memory/ptr_util.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
+
+namespace net {
+
+TestMojoProxyResolverFactory* TestMojoProxyResolverFactory::GetInstance() {
+ return base::Singleton<TestMojoProxyResolverFactory>::get();
+}
+
+std::unique_ptr<base::ScopedClosureRunner>
+TestMojoProxyResolverFactory::CreateResolver(
+ const std::string& pac_script,
+ mojo::InterfaceRequest<interfaces::ProxyResolver> req,
+ interfaces::ProxyResolverFactoryRequestClientPtr client) {
+ resolver_created_ = true;
+ factory_->CreateResolver(pac_script, std::move(req), std::move(client));
+ return nullptr;
+}
+
+TestMojoProxyResolverFactory::TestMojoProxyResolverFactory() {
+ mojo::MakeStrongBinding(base::MakeUnique<MojoProxyResolverFactoryImpl>(),
+ mojo::MakeRequest(&factory_));
+}
+
+TestMojoProxyResolverFactory::~TestMojoProxyResolverFactory() = default;
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698