Chromium Code Reviews| 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 #include "net/proxy/proxy_list.h" | 5 #include "net/proxy/proxy_list.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 } | 199 } |
| 200 | 200 |
| 201 void ProxyList::UpdateRetryInfoOnFallback( | 201 void ProxyList::UpdateRetryInfoOnFallback( |
| 202 ProxyRetryInfoMap* proxy_retry_info, | 202 ProxyRetryInfoMap* proxy_retry_info, |
| 203 base::TimeDelta retry_delay, | 203 base::TimeDelta retry_delay, |
| 204 bool reconsider, | 204 bool reconsider, |
| 205 const ProxyServer& another_proxy_to_bypass, | 205 const ProxyServer& another_proxy_to_bypass, |
| 206 const BoundNetLog& net_log) const { | 206 const BoundNetLog& net_log) const { |
| 207 // Time to wait before retrying a bad proxy server. | 207 // Time to wait before retrying a bad proxy server. |
| 208 if (retry_delay == base::TimeDelta()) { | 208 if (retry_delay == base::TimeDelta()) { |
| 209 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
|
bengr
2014/07/11 20:42:53
I would suggest keeping line 215 and removing the
Not at Google. Contact bengr
2014/07/16 22:41:34
Done.
| |
| 210 // Randomize the timeout over a range from one to five minutes. | 209 // Randomize the timeout over a range from one to five minutes. |
| 211 retry_delay = | 210 retry_delay = |
| 212 TimeDelta::FromMilliseconds( | 211 TimeDelta::FromMilliseconds( |
| 213 base::RandInt(1 * 60 * 1000, 5 * 60 * 1000)); | 212 base::RandInt(1 * 60 * 1000, 5 * 60 * 1000)); |
| 214 #else | |
| 215 retry_delay = TimeDelta::FromMinutes(5); | |
| 216 #endif | |
| 217 } | 213 } |
| 218 | 214 |
| 219 if (proxies_.empty()) { | 215 if (proxies_.empty()) { |
| 220 NOTREACHED(); | 216 NOTREACHED(); |
| 221 return; | 217 return; |
| 222 } | 218 } |
| 223 | 219 |
| 224 if (!proxies_[0].is_direct()) { | 220 if (!proxies_[0].is_direct()) { |
| 225 AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider, proxies_[0], | 221 AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider, proxies_[0], |
| 226 net_log); | 222 net_log); |
| 227 | 223 |
| 228 // If an additional proxy to bypass is specified, add it to the retry map | 224 // If an additional proxy to bypass is specified, add it to the retry map |
| 229 // as well. | 225 // as well. |
| 230 if (another_proxy_to_bypass.is_valid()) { | 226 if (another_proxy_to_bypass.is_valid()) { |
| 231 AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider, | 227 AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider, |
| 232 another_proxy_to_bypass, net_log); | 228 another_proxy_to_bypass, net_log); |
| 233 } | 229 } |
| 234 } | 230 } |
| 235 } | 231 } |
| 236 | 232 |
| 237 } // namespace net | 233 } // namespace net |
| OLD | NEW |