OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_ | |
eroman
2015/06/05 01:11:47
technically this file should be proxy_resolver_v8_
Sam McNally
2015/06/23 00:32:47
I think it already is.
| |
6 #define NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "net/base/net_export.h" | |
12 #include "net/proxy/proxy_resolver.h" | |
13 #include "net/proxy/proxy_resolver_factory.h" | |
14 #include "net/proxy/proxy_resolver_v8_tracing.h" | |
15 | |
16 namespace net { | |
17 | |
18 class HostResolver; | |
19 class NetLog; | |
20 class ProxyResolverErrorObserver; | |
21 | |
22 // A wrapper for ProxyResolverV8TracingFactory that implements the | |
23 // ProxyResolverFactory interface. | |
24 class NET_EXPORT ProxyResolverFactoryV8TracingWrapper | |
eroman
2015/06/05 01:11:47
I am not enamored with the terminology "Wrapper" f
Sam McNally
2015/06/23 00:32:47
One alternative I considered was making this Proxy
| |
25 : public ProxyResolverFactory { | |
26 public: | |
27 // Note that |host_resolver| and |net_log| are expected to outlive |this| and | |
28 // any ProxyResolver instances created using |this|. |error_observer_factory| | |
29 // will be invoked once per CreateProxyResolver() call to create a | |
30 // ProxyResolverErrorObserver to be used by the ProxyResolver instance | |
31 // returned by that call. | |
32 ProxyResolverFactoryV8TracingWrapper( | |
33 HostResolver* host_resolver, | |
34 NetLog* net_log, | |
35 const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()>& | |
36 error_observer_factory); | |
37 ~ProxyResolverFactoryV8TracingWrapper() override; | |
38 | |
39 // ProxyResolverFactory override. | |
40 int CreateProxyResolver( | |
41 const scoped_refptr<ProxyResolverScriptData>& pac_script, | |
42 scoped_ptr<ProxyResolver>* resolver, | |
43 const CompletionCallback& callback, | |
44 scoped_ptr<Request>* request) override; | |
45 | |
46 private: | |
47 class BindingsImpl; | |
48 | |
49 void OnProxyResolverCreated( | |
50 scoped_ptr<scoped_ptr<ProxyResolverV8Tracing>> v8_resolver, | |
51 scoped_ptr<ProxyResolver>* resolver, | |
52 const CompletionCallback& callback, | |
53 scoped_ptr<ProxyResolverErrorObserver> error_observer, | |
54 int error); | |
55 scoped_ptr<ProxyResolverV8TracingFactory> factory_impl_; | |
56 HostResolver* const host_resolver_; | |
57 NetLog* const net_log_; | |
58 const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()> | |
59 error_observer_factory_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactoryV8TracingWrapper); | |
62 }; | |
63 | |
64 } // namespace net | |
65 | |
66 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_WRAPPER_H_ | |
OLD | NEW |