| 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_SERVICE_H_ | 5 #ifndef NET_PROXY_PROXY_SERVICE_H_ |
| 6 #define NET_PROXY_PROXY_SERVICE_H_ | 6 #define NET_PROXY_PROXY_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 int load_flags, | 157 int load_flags, |
| 158 int net_error, | 158 int net_error, |
| 159 ProxyInfo* results, | 159 ProxyInfo* results, |
| 160 const CompletionCallback& callback, | 160 const CompletionCallback& callback, |
| 161 PacRequest** pac_request, | 161 PacRequest** pac_request, |
| 162 NetworkDelegate* network_delegate, | 162 NetworkDelegate* network_delegate, |
| 163 const BoundNetLog& net_log); | 163 const BoundNetLog& net_log); |
| 164 | 164 |
| 165 // Explicitly trigger proxy fallback for the given |results| by updating our | 165 // Explicitly trigger proxy fallback for the given |results| by updating our |
| 166 // list of bad proxies to include the first entry of |results|, and, | 166 // list of bad proxies to include the first entry of |results|, and, |
| 167 // optionally, another bad proxy. Will retry after |retry_delay| if positive, | 167 // additional bad proxies (can be none). Will retry after |retry_delay| if |
| 168 // and will use the default proxy retry duration otherwise. Proxies marked as | 168 // positive, and will use the default proxy retry duration otherwise. Proxies |
| 169 // bad will not be retried until |retry_delay| has passed. Returns true if | 169 // marked as bad will not be retried until |retry_delay| has passed. Returns |
| 170 // there will be at least one proxy remaining in the list after fallback and | 170 // true if there will be at least one proxy remaining in the list after |
| 171 // false otherwise. This method should be used to add proxies to the bad | 171 // fallback and false otherwise. This method should be used to add proxies to |
| 172 // proxy list only for reasons other than a network error. If a proxy needs | 172 // the bad proxy list only for reasons other than a network error. If a proxy |
| 173 // to be added to the bad proxy list because a network error was encountered | 173 // needs to be added to the bad proxy list because a network error was |
| 174 // when trying to connect to it, use |ReconsiderProxyAfterError|. | 174 // encountered when trying to connect to it, use |ReconsiderProxyAfterError|. |
| 175 bool MarkProxiesAsBadUntil(const ProxyInfo& results, | 175 bool MarkProxiesAsBadUntil( |
| 176 base::TimeDelta retry_delay, | 176 const ProxyInfo& results, |
| 177 const ProxyServer& another_bad_proxy, | 177 base::TimeDelta retry_delay, |
| 178 const BoundNetLog& net_log); | 178 const std::vector<ProxyServer>& additional_bad_proxies, |
| 179 const BoundNetLog& net_log); |
| 179 | 180 |
| 180 // Called to report that the last proxy connection succeeded. If |proxy_info| | 181 // Called to report that the last proxy connection succeeded. If |proxy_info| |
| 181 // has a non empty proxy_retry_info map, the proxies that have been tried (and | 182 // has a non empty proxy_retry_info map, the proxies that have been tried (and |
| 182 // failed) for this request will be marked as bad. |network_delegate| will | 183 // failed) for this request will be marked as bad. |network_delegate| will |
| 183 // be notified of any proxy fallbacks. | 184 // be notified of any proxy fallbacks. |
| 184 void ReportSuccess(const ProxyInfo& proxy_info, | 185 void ReportSuccess(const ProxyInfo& proxy_info, |
| 185 NetworkDelegate* network_delegate); | 186 NetworkDelegate* network_delegate); |
| 186 | 187 |
| 187 // Call this method with a non-null |pac_request| to cancel the PAC request. | 188 // Call this method with a non-null |pac_request| to cancel the PAC request. |
| 188 void CancelPacRequest(PacRequest* pac_request); | 189 void CancelPacRequest(PacRequest* pac_request); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 450 |
| 450 // Whether child ProxyScriptDeciders should use QuickCheck | 451 // Whether child ProxyScriptDeciders should use QuickCheck |
| 451 bool quick_check_enabled_; | 452 bool quick_check_enabled_; |
| 452 | 453 |
| 453 DISALLOW_COPY_AND_ASSIGN(ProxyService); | 454 DISALLOW_COPY_AND_ASSIGN(ProxyService); |
| 454 }; | 455 }; |
| 455 | 456 |
| 456 } // namespace net | 457 } // namespace net |
| 457 | 458 |
| 458 #endif // NET_PROXY_PROXY_SERVICE_H_ | 459 #endif // NET_PROXY_PROXY_SERVICE_H_ |
| OLD | NEW |