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

Unified Diff: net/proxy/proxy_resolver_v8_tracing_wrapper.h

Issue 1145153004: Split ProxyResolverV8Tracing into an implementation and a wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/proxy_resolver_v8_tracing_unittest.cc ('k') | net/proxy/proxy_resolver_v8_tracing_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_v8_tracing_wrapper.h
diff --git a/net/proxy/proxy_resolver_v8_tracing_wrapper.h b/net/proxy/proxy_resolver_v8_tracing_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..28343d807363b7b1c925ad6d724d339641e04b6e
--- /dev/null
+++ b/net/proxy/proxy_resolver_v8_tracing_wrapper.h
@@ -0,0 +1,65 @@
+// 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.
+
+#ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_
+#define NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "net/base/net_export.h"
+#include "net/proxy/proxy_resolver.h"
+#include "net/proxy/proxy_resolver_factory.h"
+#include "net/proxy/proxy_resolver_v8_tracing.h"
+
+namespace net {
+
+class HostResolver;
+class NetLog;
+class ProxyResolverErrorObserver;
+
+// A wrapper for ProxyResolverV8TracingFactory that implements the
+// ProxyResolverFactory interface.
+class NET_EXPORT ProxyResolverFactoryV8TracingWrapper
+ : public ProxyResolverFactory {
+ public:
+ // Note that |host_resolver| and |net_log| are expected to outlive |this| and
+ // any ProxyResolver instances created using |this|. |error_observer_factory|
+ // will be invoked once per CreateProxyResolver() call to create a
+ // ProxyResolverErrorObserver to be used by the ProxyResolver instance
+ // returned by that call.
+ ProxyResolverFactoryV8TracingWrapper(
+ HostResolver* host_resolver,
+ NetLog* net_log,
+ const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()>&
+ error_observer_factory);
+ ~ProxyResolverFactoryV8TracingWrapper() override;
+
+ // ProxyResolverFactory override.
+ int CreateProxyResolver(
+ const scoped_refptr<ProxyResolverScriptData>& pac_script,
+ scoped_ptr<ProxyResolver>* resolver,
+ const CompletionCallback& callback,
+ scoped_ptr<Request>* request) override;
+
+ private:
+ void OnProxyResolverCreated(
+ scoped_ptr<scoped_ptr<ProxyResolverV8Tracing>> v8_resolver,
+ scoped_ptr<ProxyResolver>* resolver,
+ const CompletionCallback& callback,
+ scoped_ptr<ProxyResolverErrorObserver> error_observer,
+ int error);
+
+ scoped_ptr<ProxyResolverV8TracingFactory> factory_impl_;
+ HostResolver* const host_resolver_;
+ NetLog* const net_log_;
+ const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()>
+ error_observer_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactoryV8TracingWrapper);
+};
+
+} // namespace net
+
+#endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_
« no previous file with comments | « net/proxy/proxy_resolver_v8_tracing_unittest.cc ('k') | net/proxy/proxy_resolver_v8_tracing_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698