| 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_LIST_H_ | 5 #ifndef NET_PROXY_PROXY_LIST_H_ |
| 6 #define NET_PROXY_PROXY_LIST_H_ | 6 #define NET_PROXY_PROXY_LIST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 bool Fallback(ProxyRetryInfoMap* proxy_retry_info, | 84 bool Fallback(ProxyRetryInfoMap* proxy_retry_info, |
| 85 const BoundNetLog& net_log); | 85 const BoundNetLog& net_log); |
| 86 | 86 |
| 87 // Updates |proxy_retry_info| to indicate that the first proxy in the list | 87 // Updates |proxy_retry_info| to indicate that the first proxy in the list |
| 88 // is bad. This is distinct from Fallback(), above, to allow updating proxy | 88 // is bad. This is distinct from Fallback(), above, to allow updating proxy |
| 89 // retry information without modifying a given transction's proxy list. Will | 89 // retry information without modifying a given transction's proxy list. Will |
| 90 // retry after |retry_delay| if positive, and will use the default proxy retry | 90 // retry after |retry_delay| if positive, and will use the default proxy retry |
| 91 // duration otherwise. It may reconsider the proxy beforehand if |reconsider| | 91 // duration otherwise. It may reconsider the proxy beforehand if |reconsider| |
| 92 // is true. Additionally updates |proxy_retry_info| with | 92 // is true. Additionally updates |proxy_retry_info| with |
| 93 // |another_proxy_to_bypass| if non-empty. | 93 // |another_proxy_to_bypass| if non-empty. |
| 94 void UpdateRetryInfoOnFallback( | 94 void UpdateRetryInfoOnFallback(ProxyRetryInfoMap* proxy_retry_info, |
| 95 ProxyRetryInfoMap* proxy_retry_info, | 95 base::TimeDelta retry_delay, |
| 96 base::TimeDelta retry_delay, | 96 bool reconsider, |
| 97 bool reconsider, | 97 const ProxyServer& another_proxy_to_bypass, |
| 98 const ProxyServer& another_proxy_to_bypass, | 98 const BoundNetLog& net_log) const; |
| 99 const BoundNetLog& net_log) const; | |
| 100 | 99 |
| 101 private: | 100 private: |
| 102 // Updates |proxy_retry_info| to indicate that the |proxy_to_retry| in | 101 // Updates |proxy_retry_info| to indicate that the |proxy_to_retry| in |
| 103 // |proxies_| is bad for |retry_delay|, but may be reconsidered earlier if | 102 // |proxies_| is bad for |retry_delay|, but may be reconsidered earlier if |
| 104 // |try_while_bad| is true. | 103 // |try_while_bad| is true. |
| 105 void AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info, | 104 void AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info, |
| 106 base::TimeDelta retry_delay, | 105 base::TimeDelta retry_delay, |
| 107 bool try_while_bad, | 106 bool try_while_bad, |
| 108 const ProxyServer& proxy_to_retry, | 107 const ProxyServer& proxy_to_retry, |
| 109 const BoundNetLog& net_log) const; | 108 const BoundNetLog& net_log) const; |
| 110 | 109 |
| 111 // List of proxies. | 110 // List of proxies. |
| 112 std::vector<ProxyServer> proxies_; | 111 std::vector<ProxyServer> proxies_; |
| 113 }; | 112 }; |
| 114 | 113 |
| 115 } // namespace net | 114 } // namespace net |
| 116 | 115 |
| 117 #endif // NET_PROXY_PROXY_LIST_H_ | 116 #endif // NET_PROXY_PROXY_LIST_H_ |
| OLD | NEW |