OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ | 5 #ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ |
6 #define NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ | 6 #define NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 private: | 44 private: |
45 DISALLOW_COPY_AND_ASSIGN(Bindings); | 45 DISALLOW_COPY_AND_ASSIGN(Bindings); |
46 }; | 46 }; |
47 | 47 |
48 virtual ~ProxyResolverV8Tracing() {} | 48 virtual ~ProxyResolverV8Tracing() {} |
49 | 49 |
50 // Gets a list of proxy servers to use for |url|. This request always | 50 // Gets a list of proxy servers to use for |url|. This request always |
51 // runs asynchronously and notifies the result by running |callback|. If the | 51 // runs asynchronously and notifies the result by running |callback|. If the |
52 // result code is OK then the request was successful and |results| contains | 52 // result code is OK then the request was successful and |results| contains |
53 // the proxy resolution information. Request can be cancelled by resetting | 53 // the proxy resolution information. If |request| is non-null, |*request| is |
54 // |*request|. | 54 // written to, and can be passed to CancelRequest(). |
55 virtual void GetProxyForURL(const GURL& url, | 55 virtual void GetProxyForURL(const GURL& url, |
56 ProxyInfo* results, | 56 ProxyInfo* results, |
57 const CompletionCallback& callback, | 57 const CompletionCallback& callback, |
58 scoped_ptr<ProxyResolver::Request>* request, | 58 ProxyResolver::RequestHandle* request, |
59 scoped_ptr<Bindings> bindings) = 0; | 59 scoped_ptr<Bindings> bindings) = 0; |
| 60 |
| 61 // Cancels |request|. |
| 62 virtual void CancelRequest(ProxyResolver::RequestHandle request) = 0; |
| 63 |
| 64 // Gets the LoadState for |request|. |
| 65 virtual LoadState GetLoadState( |
| 66 ProxyResolver::RequestHandle request) const = 0; |
60 }; | 67 }; |
61 | 68 |
62 // A factory for ProxyResolverV8Tracing instances. The default implementation, | 69 // A factory for ProxyResolverV8Tracing instances. The default implementation, |
63 // returned by Create(), creates ProxyResolverV8Tracing instances that execute | 70 // returned by Create(), creates ProxyResolverV8Tracing instances that execute |
64 // ProxyResolverV8 on a single helper thread, and do some magic to avoid | 71 // ProxyResolverV8 on a single helper thread, and do some magic to avoid |
65 // blocking in DNS. For more details see the design document: | 72 // blocking in DNS. For more details see the design document: |
66 // https://docs.google.com/a/google.com/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPoMJ
daBn9rKreAmGOdE/edit?pli=1 | 73 // https://docs.google.com/a/google.com/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPoMJ
daBn9rKreAmGOdE/edit?pli=1 |
67 class NET_EXPORT ProxyResolverV8TracingFactory { | 74 class NET_EXPORT ProxyResolverV8TracingFactory { |
68 public: | 75 public: |
69 ProxyResolverV8TracingFactory() {} | 76 ProxyResolverV8TracingFactory() {} |
70 virtual ~ProxyResolverV8TracingFactory() = default; | 77 virtual ~ProxyResolverV8TracingFactory() = default; |
71 | 78 |
72 virtual void CreateProxyResolverV8Tracing( | 79 virtual void CreateProxyResolverV8Tracing( |
73 const scoped_refptr<ProxyResolverScriptData>& pac_script, | 80 const scoped_refptr<ProxyResolverScriptData>& pac_script, |
74 scoped_ptr<ProxyResolverV8Tracing::Bindings> bindings, | 81 scoped_ptr<ProxyResolverV8Tracing::Bindings> bindings, |
75 scoped_ptr<ProxyResolverV8Tracing>* resolver, | 82 scoped_ptr<ProxyResolverV8Tracing>* resolver, |
76 const CompletionCallback& callback, | 83 const CompletionCallback& callback, |
77 scoped_ptr<ProxyResolverFactory::Request>* request) = 0; | 84 scoped_ptr<ProxyResolverFactory::Request>* request) = 0; |
78 | 85 |
79 static scoped_ptr<ProxyResolverV8TracingFactory> Create(); | 86 static scoped_ptr<ProxyResolverV8TracingFactory> Create(); |
80 | 87 |
81 private: | 88 private: |
82 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8TracingFactory); | 89 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8TracingFactory); |
83 }; | 90 }; |
84 | 91 |
85 } // namespace net | 92 } // namespace net |
86 | 93 |
87 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ | 94 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ |
OLD | NEW |