| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 bool Fallback(ProxyRetryInfoMap* proxy_retry_info, | 90 bool Fallback(ProxyRetryInfoMap* proxy_retry_info, |
| 91 int net_error, | 91 int net_error, |
| 92 const BoundNetLog& net_log); | 92 const BoundNetLog& net_log); |
| 93 | 93 |
| 94 // Updates |proxy_retry_info| to indicate that the first proxy in the list | 94 // Updates |proxy_retry_info| to indicate that the first proxy in the list |
| 95 // is bad. This is distinct from Fallback(), above, to allow updating proxy | 95 // is bad. This is distinct from Fallback(), above, to allow updating proxy |
| 96 // retry information without modifying a given transction's proxy list. Will | 96 // retry information without modifying a given transction's proxy list. Will |
| 97 // retry after |retry_delay| if positive, and will use the default proxy retry | 97 // retry after |retry_delay| if positive, and will use the default proxy retry |
| 98 // duration otherwise. It may reconsider the proxy beforehand if |reconsider| | 98 // duration otherwise. It may reconsider the proxy beforehand if |reconsider| |
| 99 // is true. Additionally updates |proxy_retry_info| with | 99 // is true. Additionally updates |proxy_retry_info| with |
| 100 // |another_proxy_to_bypass| if non-empty. |net_error| should contain the | 100 // |additional_proxies_to_bypass|. |net_error| should contain the network |
| 101 // network error countered when this proxy was tried, or OK if the proxy retry | 101 // error countered when this proxy was tried, or OK if the proxy retry info is |
| 102 // info is being updated for a non-network related reason (e.g. local policy). | 102 // being updated for a non-network related reason (e.g. local policy). |
| 103 void UpdateRetryInfoOnFallback( | 103 void UpdateRetryInfoOnFallback( |
| 104 ProxyRetryInfoMap* proxy_retry_info, | 104 ProxyRetryInfoMap* proxy_retry_info, |
| 105 base::TimeDelta retry_delay, | 105 base::TimeDelta retry_delay, |
| 106 bool reconsider, | 106 bool reconsider, |
| 107 const ProxyServer& another_proxy_to_bypass, | 107 const std::vector<ProxyServer>& additional_proxies_to_bypass, |
| 108 int net_error, | 108 int net_error, |
| 109 const BoundNetLog& net_log) const; | 109 const BoundNetLog& net_log) const; |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 // Updates |proxy_retry_info| to indicate that the |proxy_to_retry| in | 112 // Updates |proxy_retry_info| to indicate that the |proxy_to_retry| in |
| 113 // |proxies_| is bad for |retry_delay|, but may be reconsidered earlier if | 113 // |proxies_| is bad for |retry_delay|, but may be reconsidered earlier if |
| 114 // |try_while_bad| is true. |net_error| should contain the network error | 114 // |try_while_bad| is true. |net_error| should contain the network error |
| 115 // countered when this proxy was tried, or OK if the proxy retry info is | 115 // countered when this proxy was tried, or OK if the proxy retry info is |
| 116 // being updated for a non-network related reason (e.g. local policy). | 116 // being updated for a non-network related reason (e.g. local policy). |
| 117 void AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info, | 117 void AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info, |
| 118 base::TimeDelta retry_delay, | 118 base::TimeDelta retry_delay, |
| 119 bool try_while_bad, | 119 bool try_while_bad, |
| 120 const ProxyServer& proxy_to_retry, | 120 const ProxyServer& proxy_to_retry, |
| 121 int net_error, | 121 int net_error, |
| 122 const BoundNetLog& net_log) const; | 122 const BoundNetLog& net_log) const; |
| 123 | 123 |
| 124 // List of proxies. | 124 // List of proxies. |
| 125 std::vector<ProxyServer> proxies_; | 125 std::vector<ProxyServer> proxies_; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace net | 128 } // namespace net |
| 129 | 129 |
| 130 #endif // NET_PROXY_PROXY_LIST_H_ | 130 #endif // NET_PROXY_PROXY_LIST_H_ |
| OLD | NEW |