OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_INFO_H_ | 5 #ifndef NET_PROXY_PROXY_INFO_H_ |
6 #define NET_PROXY_PROXY_INFO_H_ | 6 #define NET_PROXY_PROXY_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/proxy/proxy_config.h" | 10 #include "net/proxy/proxy_config.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // See description in ProxyList::ToPacString(). | 62 // See description in ProxyList::ToPacString(). |
63 std::string ToPacString() const; | 63 std::string ToPacString() const; |
64 | 64 |
65 // Marks the current proxy as bad. Returns true if there is another proxy | 65 // Marks the current proxy as bad. Returns true if there is another proxy |
66 // available to try in proxy list_. | 66 // available to try in proxy list_. |
67 bool Fallback(ProxyRetryInfoMap* proxy_retry_info) { | 67 bool Fallback(ProxyRetryInfoMap* proxy_retry_info) { |
68 return proxy_list_.Fallback(proxy_retry_info); | 68 return proxy_list_.Fallback(proxy_retry_info); |
69 } | 69 } |
70 | 70 |
71 // Remove all proxies known to be bad from the proxy list. | 71 // De-prioritizes the proxies that we have cached as not working, by moving |
72 void RemoveBadProxies(const ProxyRetryInfoMap& proxy_retry_info) { | 72 // them to the end of the proxy list. |
73 proxy_list_.RemoveBadProxies(proxy_retry_info); | 73 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info) { |
| 74 proxy_list_.DeprioritizeBadProxies(proxy_retry_info); |
74 } | 75 } |
75 | 76 |
76 // Delete any entry which doesn't have one of the specified proxy schemes. | 77 // Delete any entry which doesn't have one of the specified proxy schemes. |
77 void RemoveProxiesWithoutScheme(int scheme_bit_field) { | 78 void RemoveProxiesWithoutScheme(int scheme_bit_field) { |
78 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); | 79 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); |
79 } | 80 } |
80 | 81 |
81 private: | 82 private: |
82 friend class ProxyService; | 83 friend class ProxyService; |
83 | 84 |
84 // The ordered list of proxy servers (including DIRECT attempts) remaining to | 85 // The ordered list of proxy servers (including DIRECT attempts) remaining to |
85 // try. If proxy_list_ is empty, then there is nothing left to fall back to. | 86 // try. If proxy_list_ is empty, then there is nothing left to fall back to. |
86 ProxyList proxy_list_; | 87 ProxyList proxy_list_; |
87 | 88 |
88 // This value identifies the proxy config used to initialize this object. | 89 // This value identifies the proxy config used to initialize this object. |
89 ProxyConfig::ID config_id_; | 90 ProxyConfig::ID config_id_; |
90 }; | 91 }; |
91 | 92 |
92 } // namespace net | 93 } // namespace net |
93 | 94 |
94 #endif // NET_PROXY_PROXY_INFO_H_ | 95 #endif // NET_PROXY_PROXY_INFO_H_ |
OLD | NEW |