| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return proxy_server().is_socks(); | 70 return proxy_server().is_socks(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Returns true if this proxy info has no proxies left to try. | 73 // Returns true if this proxy info has no proxies left to try. |
| 74 bool is_empty() const { | 74 bool is_empty() const { |
| 75 return proxy_list_.IsEmpty(); | 75 return proxy_list_.IsEmpty(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Returns the first valid proxy server. is_empty() must be false to be able | 78 // Returns the first valid proxy server. is_empty() must be false to be able |
| 79 // to call this function. | 79 // to call this function. |
| 80 ProxyServer proxy_server() const { return proxy_list_.Get(); } | 80 const ProxyServer& proxy_server() const { return proxy_list_.Get(); } |
| 81 | 81 |
| 82 // See description in ProxyList::ToPacString(). | 82 // See description in ProxyList::ToPacString(). |
| 83 std::string ToPacString() const; | 83 std::string ToPacString() const; |
| 84 | 84 |
| 85 // Marks the current proxy as bad. Returns true if there is another proxy | 85 // Marks the current proxy as bad. Returns true if there is another proxy |
| 86 // available to try in proxy list_. | 86 // available to try in proxy list_. |
| 87 bool Fallback(ProxyRetryInfoMap* proxy_retry_info) { | 87 bool Fallback(ProxyRetryInfoMap* proxy_retry_info) { |
| 88 return proxy_list_.Fallback(proxy_retry_info); | 88 return proxy_list_.Fallback(proxy_retry_info); |
| 89 } | 89 } |
| 90 | 90 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 106 // try. If proxy_list_ is empty, then there is nothing left to fall back to. | 106 // try. If proxy_list_ is empty, then there is nothing left to fall back to. |
| 107 ProxyList proxy_list_; | 107 ProxyList proxy_list_; |
| 108 | 108 |
| 109 // This value identifies the proxy config used to initialize this object. | 109 // This value identifies the proxy config used to initialize this object. |
| 110 ProxyConfig::ID config_id_; | 110 ProxyConfig::ID config_id_; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace net | 113 } // namespace net |
| 114 | 114 |
| 115 #endif // NET_PROXY_PROXY_INFO_H_ | 115 #endif // NET_PROXY_PROXY_INFO_H_ |
| OLD | NEW |