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