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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/synchronization/waitable_event.h" | 18 #include "base/synchronization/waitable_event.h" |
19 #include "base/threading/non_thread_safe.h" | 19 #include "base/threading/thread_checker.h" |
20 #include "net/base/completion_callback.h" | 20 #include "net/base/completion_callback.h" |
21 #include "net/base/load_states.h" | 21 #include "net/base/load_states.h" |
22 #include "net/base/net_export.h" | 22 #include "net/base/net_export.h" |
23 #include "net/base/network_change_notifier.h" | 23 #include "net/base/network_change_notifier.h" |
24 #include "net/proxy/proxy_config_service.h" | 24 #include "net/proxy/proxy_config_service.h" |
25 #include "net/proxy/proxy_info.h" | 25 #include "net/proxy/proxy_info.h" |
26 #include "net/proxy/proxy_server.h" | 26 #include "net/proxy/proxy_server.h" |
27 #include "url/gurl.h" | 27 #include "url/gurl.h" |
28 | 28 |
29 class GURL; | 29 class GURL; |
(...skipping 12 matching lines...) Expand all Loading... |
42 class ProxyResolver; | 42 class ProxyResolver; |
43 class ProxyResolverFactory; | 43 class ProxyResolverFactory; |
44 class ProxyResolverScriptData; | 44 class ProxyResolverScriptData; |
45 class ProxyScriptFetcher; | 45 class ProxyScriptFetcher; |
46 | 46 |
47 // This class can be used to resolve the proxy server to use when loading a | 47 // This class can be used to resolve the proxy server to use when loading a |
48 // HTTP(S) URL. It uses the given ProxyResolver to handle the actual proxy | 48 // HTTP(S) URL. It uses the given ProxyResolver to handle the actual proxy |
49 // resolution. See ProxyResolverV8 for example. | 49 // resolution. See ProxyResolverV8 for example. |
50 class NET_EXPORT ProxyService : public NetworkChangeNotifier::IPAddressObserver, | 50 class NET_EXPORT ProxyService : public NetworkChangeNotifier::IPAddressObserver, |
51 public NetworkChangeNotifier::DNSObserver, | 51 public NetworkChangeNotifier::DNSObserver, |
52 public ProxyConfigService::Observer, | 52 public ProxyConfigService::Observer { |
53 NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
54 public: | 53 public: |
55 // Enumerates the policy to use when sanitizing URLs for proxy resolution | 54 // Enumerates the policy to use when sanitizing URLs for proxy resolution |
56 // (before passing them off to PAC scripts). | 55 // (before passing them off to PAC scripts). |
57 enum class SanitizeUrlPolicy { | 56 enum class SanitizeUrlPolicy { |
58 // Do a basic level of sanitization for URLs: | 57 // Do a basic level of sanitization for URLs: |
59 // - strip embedded identities (ex: "username:password@") | 58 // - strip embedded identities (ex: "username:password@") |
60 // - strip the fragment (ex: "#blah") | 59 // - strip the fragment (ex: "#blah") |
61 // | 60 // |
62 // This is considered "unsafe" because it does not do any additional | 61 // This is considered "unsafe" because it does not do any additional |
63 // stripping for https:// URLs. | 62 // stripping for https:// URLs. |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 474 |
476 // The amount of time to stall requests following IP address changes. | 475 // The amount of time to stall requests following IP address changes. |
477 base::TimeDelta stall_proxy_auto_config_delay_; | 476 base::TimeDelta stall_proxy_auto_config_delay_; |
478 | 477 |
479 // Whether child ProxyScriptDeciders should use QuickCheck | 478 // Whether child ProxyScriptDeciders should use QuickCheck |
480 bool quick_check_enabled_; | 479 bool quick_check_enabled_; |
481 | 480 |
482 // The method to use for sanitizing URLs seen by the proxy resolver. | 481 // The method to use for sanitizing URLs seen by the proxy resolver. |
483 SanitizeUrlPolicy sanitize_url_policy_; | 482 SanitizeUrlPolicy sanitize_url_policy_; |
484 | 483 |
| 484 THREAD_CHECKER(thread_checker_); |
| 485 |
485 DISALLOW_COPY_AND_ASSIGN(ProxyService); | 486 DISALLOW_COPY_AND_ASSIGN(ProxyService); |
486 }; | 487 }; |
487 | 488 |
488 } // namespace net | 489 } // namespace net |
489 | 490 |
490 #endif // NET_PROXY_PROXY_SERVICE_H_ | 491 #endif // NET_PROXY_PROXY_SERVICE_H_ |
OLD | NEW |