OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SERVICE_H_ | 5 #ifndef NET_PROXY_PROXY_SERVICE_H_ |
6 #define NET_PROXY_PROXY_SERVICE_H_ | 6 #define NET_PROXY_PROXY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 | 229 |
230 // Forces refetching the proxy configuration, and applying it. | 230 // Forces refetching the proxy configuration, and applying it. |
231 // This re-does everything from fetching the system configuration, | 231 // This re-does everything from fetching the system configuration, |
232 // to downloading and testing the PAC files. | 232 // to downloading and testing the PAC files. |
233 void ForceReloadProxyConfig(); | 233 void ForceReloadProxyConfig(); |
234 | 234 |
235 // Same as CreateProxyServiceUsingV8ProxyResolver, except it uses system | 235 // Same as CreateProxyServiceUsingV8ProxyResolver, except it uses system |
236 // libraries for evaluating the PAC script if available, otherwise skips | 236 // libraries for evaluating the PAC script if available, otherwise skips |
237 // proxy autoconfig. | 237 // proxy autoconfig. |
238 static ProxyService* CreateUsingSystemProxyResolver( | 238 static scoped_ptr<ProxyService> CreateUsingSystemProxyResolver( |
239 ProxyConfigService* proxy_config_service, | 239 ProxyConfigService* proxy_config_service, |
240 size_t num_pac_threads, | 240 size_t num_pac_threads, |
241 NetLog* net_log); | 241 NetLog* net_log); |
242 | 242 |
243 // Creates a ProxyService without support for proxy autoconfig. | 243 // Creates a ProxyService without support for proxy autoconfig. |
244 static ProxyService* CreateWithoutProxyResolver( | 244 static scoped_ptr<ProxyService> CreateWithoutProxyResolver( |
245 ProxyConfigService* proxy_config_service, | 245 ProxyConfigService* proxy_config_service, |
246 NetLog* net_log); | 246 NetLog* net_log); |
247 | 247 |
248 // Convenience methods that creates a proxy service using the | 248 // Convenience methods that creates a proxy service using the |
249 // specified fixed settings. | 249 // specified fixed settings. |
250 static ProxyService* CreateFixed(const ProxyConfig& pc); | 250 static scoped_ptr<ProxyService> CreateFixed(const ProxyConfig& pc); |
251 static ProxyService* CreateFixed(const std::string& proxy); | 251 static scoped_ptr<ProxyService> CreateFixed(const std::string& proxy); |
252 | 252 |
253 // Creates a proxy service that uses a DIRECT connection for all requests. | 253 // Creates a proxy service that uses a DIRECT connection for all requests. |
254 static ProxyService* CreateDirect(); | 254 static scoped_ptr<ProxyService> CreateDirect(); |
255 // |net_log|'s lifetime must exceed ProxyService. | 255 // |net_log|'s lifetime must exceed ProxyService. |
256 static ProxyService* CreateDirectWithNetLog(NetLog* net_log); | 256 static scoped_ptr<ProxyService> CreateDirectWithNetLog(NetLog* net_log); |
257 | 257 |
258 // This method is used by tests to create a ProxyService that returns a | 258 // This method is used by tests to create a ProxyService that returns a |
259 // hardcoded proxy fallback list (|pac_string|) for every URL. | 259 // hardcoded proxy fallback list (|pac_string|) for every URL. |
260 // | 260 // |
261 // |pac_string| is a list of proxy servers, in the format that a PAC script | 261 // |pac_string| is a list of proxy servers, in the format that a PAC script |
262 // would return it. For example, "PROXY foobar:99; SOCKS fml:2; DIRECT" | 262 // would return it. For example, "PROXY foobar:99; SOCKS fml:2; DIRECT" |
263 static ProxyService* CreateFixedFromPacResult(const std::string& pac_string); | 263 static scoped_ptr<ProxyService> CreateFixedFromPacResult( |
| 264 const std::string& pac_string); |
264 | 265 |
265 // Creates a config service appropriate for this platform that fetches the | 266 // Creates a config service appropriate for this platform that fetches the |
266 // system proxy settings. | 267 // system proxy settings. |
267 static ProxyConfigService* CreateSystemProxyConfigService( | 268 static ProxyConfigService* CreateSystemProxyConfigService( |
268 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 269 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
269 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); | 270 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); |
270 | 271 |
271 // This method should only be used by unit tests. | 272 // This method should only be used by unit tests. |
272 void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { | 273 void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { |
273 stall_proxy_auto_config_delay_ = delay; | 274 stall_proxy_auto_config_delay_ = delay; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 450 |
450 // Whether child ProxyScriptDeciders should use QuickCheck | 451 // Whether child ProxyScriptDeciders should use QuickCheck |
451 bool quick_check_enabled_; | 452 bool quick_check_enabled_; |
452 | 453 |
453 DISALLOW_COPY_AND_ASSIGN(ProxyService); | 454 DISALLOW_COPY_AND_ASSIGN(ProxyService); |
454 }; | 455 }; |
455 | 456 |
456 } // namespace net | 457 } // namespace net |
457 | 458 |
458 #endif // NET_PROXY_PROXY_SERVICE_H_ | 459 #endif // NET_PROXY_PROXY_SERVICE_H_ |
OLD | NEW |