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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
17 #include "net/base/load_states.h" | 17 #include "net/base/load_states.h" |
18 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
19 #include "net/base/net_log.h" | 19 #include "net/base/net_log.h" |
20 #include "net/base/network_change_notifier.h" | 20 #include "net/base/network_change_notifier.h" |
21 #include "net/proxy/proxy_config_service.h" | 21 #include "net/proxy/proxy_config_service.h" |
22 #include "net/proxy/proxy_info.h" | 22 #include "net/proxy/proxy_info.h" |
23 #include "net/proxy/proxy_server.h" | 23 #include "net/proxy/proxy_server.h" |
24 | 24 |
25 class GURL; | 25 class GURL; |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class MessageLoop; | |
29 class SingleThreadTaskRunner; | 28 class SingleThreadTaskRunner; |
30 class TimeDelta; | 29 class TimeDelta; |
31 } // namespace base | 30 } // namespace base |
32 | 31 |
33 namespace net { | 32 namespace net { |
34 | 33 |
35 class DhcpProxyScriptFetcher; | 34 class DhcpProxyScriptFetcher; |
36 class HostResolver; | 35 class HostResolver; |
37 class NetworkDelegate; | 36 class NetworkDelegate; |
38 class ProxyResolver; | 37 class ProxyResolver; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // This method is used by tests to create a ProxyService that returns a | 247 // This method is used by tests to create a ProxyService that returns a |
249 // hardcoded proxy fallback list (|pac_string|) for every URL. | 248 // hardcoded proxy fallback list (|pac_string|) for every URL. |
250 // | 249 // |
251 // |pac_string| is a list of proxy servers, in the format that a PAC script | 250 // |pac_string| is a list of proxy servers, in the format that a PAC script |
252 // would return it. For example, "PROXY foobar:99; SOCKS fml:2; DIRECT" | 251 // would return it. For example, "PROXY foobar:99; SOCKS fml:2; DIRECT" |
253 static ProxyService* CreateFixedFromPacResult(const std::string& pac_string); | 252 static ProxyService* CreateFixedFromPacResult(const std::string& pac_string); |
254 | 253 |
255 // Creates a config service appropriate for this platform that fetches the | 254 // Creates a config service appropriate for this platform that fetches the |
256 // system proxy settings. | 255 // system proxy settings. |
257 static ProxyConfigService* CreateSystemProxyConfigService( | 256 static ProxyConfigService* CreateSystemProxyConfigService( |
258 base::SingleThreadTaskRunner* io_thread_task_runner, | 257 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
259 base::MessageLoop* file_loop); | 258 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); |
260 | 259 |
261 // This method should only be used by unit tests. | 260 // This method should only be used by unit tests. |
262 void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { | 261 void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { |
263 stall_proxy_auto_config_delay_ = delay; | 262 stall_proxy_auto_config_delay_ = delay; |
264 } | 263 } |
265 | 264 |
266 // This method should only be used by unit tests. Returns the previously | 265 // This method should only be used by unit tests. Returns the previously |
267 // active policy. | 266 // active policy. |
268 static const PacPollPolicy* set_pac_script_poll_policy( | 267 static const PacPollPolicy* set_pac_script_poll_policy( |
269 const PacPollPolicy* policy); | 268 const PacPollPolicy* policy); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 428 |
430 // Whether child ProxyScriptDeciders should use QuickCheck | 429 // Whether child ProxyScriptDeciders should use QuickCheck |
431 bool quick_check_enabled_; | 430 bool quick_check_enabled_; |
432 | 431 |
433 DISALLOW_COPY_AND_ASSIGN(ProxyService); | 432 DISALLOW_COPY_AND_ASSIGN(ProxyService); |
434 }; | 433 }; |
435 | 434 |
436 } // namespace net | 435 } // namespace net |
437 | 436 |
438 #endif // NET_PROXY_PROXY_SERVICE_H_ | 437 #endif // NET_PROXY_PROXY_SERVICE_H_ |
OLD | NEW |