| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Returns true if this proxy info has no proxies left to try. | 53 // Returns true if this proxy info has no proxies left to try. |
| 54 bool is_empty() const { | 54 bool is_empty() const { |
| 55 return proxy_list_.IsEmpty(); | 55 return proxy_list_.IsEmpty(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Returns the first valid proxy server. is_empty() must be false to be able | 58 // Returns the first valid proxy server. is_empty() must be false to be able |
| 59 // to call this function. | 59 // to call this function. |
| 60 ProxyServer proxy_server() const { return proxy_list_.Get(); } | 60 ProxyServer proxy_server() const { return proxy_list_.Get(); } |
| 61 | 61 |
| 62 // See description in ProxyList::ToPacString(). | 62 // See description in ProxyList::ToPacString(). |
| 63 std::string ToPacString(); | 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 // Remove all proxies known to be bad from the proxy list. |
| 72 void RemoveBadProxies(const ProxyRetryInfoMap& proxy_retry_info) { | 72 void RemoveBadProxies(const ProxyRetryInfoMap& proxy_retry_info) { |
| 73 proxy_list_.RemoveBadProxies(proxy_retry_info); | 73 proxy_list_.RemoveBadProxies(proxy_retry_info); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 85 // try. If proxy_list_ is empty, then there is nothing left to fall back to. | 85 // try. If proxy_list_ is empty, then there is nothing left to fall back to. |
| 86 ProxyList proxy_list_; | 86 ProxyList proxy_list_; |
| 87 | 87 |
| 88 // This value identifies the proxy config used to initialize this object. | 88 // This value identifies the proxy config used to initialize this object. |
| 89 ProxyConfig::ID config_id_; | 89 ProxyConfig::ID config_id_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace net | 92 } // namespace net |
| 93 | 93 |
| 94 #endif // NET_PROXY_PROXY_INFO_H_ | 94 #endif // NET_PROXY_PROXY_INFO_H_ |
| OLD | NEW |