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_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 "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Returns the first valid proxy server. is_empty() must be false to be able | 108 // Returns the first valid proxy server. is_empty() must be false to be able |
109 // to call this function. | 109 // to call this function. |
110 const ProxyServer& proxy_server() const { return proxy_list_.Get(); } | 110 const ProxyServer& proxy_server() const { return proxy_list_.Get(); } |
111 | 111 |
112 // Returns the source for configuration settings used for proxy resolution. | 112 // Returns the source for configuration settings used for proxy resolution. |
113 ProxyConfigSource config_source() const { return config_source_; } | 113 ProxyConfigSource config_source() const { return config_source_; } |
114 | 114 |
115 // See description in ProxyList::ToPacString(). | 115 // See description in ProxyList::ToPacString(). |
116 std::string ToPacString() const; | 116 std::string ToPacString() const; |
117 | 117 |
118 // Marks the current proxy as bad. Returns true if there is another proxy | 118 // Marks the current proxy as bad. |net_error| should contain the network |
| 119 // error encountered when this proxy was tried, if any. If this fallback |
| 120 // is not because of a network error, then |OK| should be passed in (eg. for |
| 121 // reasons such as local policy). Returns true if there is another proxy is |
119 // available to try in proxy list_. | 122 // available to try in proxy list_. |
120 bool Fallback(const BoundNetLog& net_log); | 123 bool Fallback(int net_error, const BoundNetLog& net_log); |
121 | 124 |
122 // De-prioritizes the proxies that we have cached as not working, by moving | 125 // De-prioritizes the proxies that we have cached as not working, by moving |
123 // them to the end of the proxy list. | 126 // them to the end of the proxy list. |
124 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); | 127 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); |
125 | 128 |
126 // Deletes any entry which doesn't have one of the specified proxy schemes. | 129 // Deletes any entry which doesn't have one of the specified proxy schemes. |
127 void RemoveProxiesWithoutScheme(int scheme_bit_field); | 130 void RemoveProxiesWithoutScheme(int scheme_bit_field); |
128 | 131 |
129 ProxyConfig::ID config_id() const { return config_id_; } | 132 ProxyConfig::ID config_id() const { return config_id_; } |
130 | 133 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 170 |
168 // How long it took to resolve the proxy. Times are both null if proxy was | 171 // How long it took to resolve the proxy. Times are both null if proxy was |
169 // determined synchronously without running a PAC. | 172 // determined synchronously without running a PAC. |
170 base::TimeTicks proxy_resolve_start_time_; | 173 base::TimeTicks proxy_resolve_start_time_; |
171 base::TimeTicks proxy_resolve_end_time_; | 174 base::TimeTicks proxy_resolve_end_time_; |
172 }; | 175 }; |
173 | 176 |
174 } // namespace net | 177 } // namespace net |
175 | 178 |
176 #endif // NET_PROXY_PROXY_INFO_H_ | 179 #endif // NET_PROXY_PROXY_INFO_H_ |
OLD | NEW |