OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_FACTORY_H_ | 5 #ifndef NET_PROXY_PROXY_RESOLVER_FACTORY_H_ |
6 #define NET_PROXY_PROXY_RESOLVER_FACTORY_H_ | 6 #define NET_PROXY_PROXY_RESOLVER_FACTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // then the ProxyResolverScriptData passed to CreateProxyResolver() should | 48 // then the ProxyResolverScriptData passed to CreateProxyResolver() should |
49 // contain the actual script bytes rather than just the URL. | 49 // contain the actual script bytes rather than just the URL. |
50 bool expects_pac_bytes() const { return expects_pac_bytes_; } | 50 bool expects_pac_bytes() const { return expects_pac_bytes_; } |
51 | 51 |
52 private: | 52 private: |
53 bool expects_pac_bytes_; | 53 bool expects_pac_bytes_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactory); | 55 DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactory); |
56 }; | 56 }; |
57 | 57 |
58 class NET_EXPORT LegacyProxyResolverFactory : public ProxyResolverFactory { | |
59 public: | |
60 explicit LegacyProxyResolverFactory(bool expects_pac_bytes); | |
61 | |
62 ~LegacyProxyResolverFactory() override; | |
63 | |
64 int CreateProxyResolver( | |
65 const scoped_refptr<ProxyResolverScriptData>& pac_script, | |
66 scoped_ptr<ProxyResolver>* resolver, | |
67 const net::CompletionCallback& callback, | |
68 scoped_ptr<Request>* request) override; | |
69 | |
70 virtual scoped_ptr<ProxyResolver> CreateProxyResolver() = 0; | |
71 | |
72 private: | |
73 class Job; | |
74 | |
75 void RemoveJob(Job* job); | |
76 | |
77 std::set<Job*> jobs_; | |
78 }; | |
79 | |
80 } // namespace net | 58 } // namespace net |
81 | 59 |
82 #endif // NET_PROXY_PROXY_RESOLVER_FACTORY_H_ | 60 #endif // NET_PROXY_PROXY_RESOLVER_FACTORY_H_ |
OLD | NEW |