Index: components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
index fa75c6b6cb7a5e255799742c871ca198a55e7d78..5cdc9cd275c5a453dca784a1af70067ab8b7af13 100644 |
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
@@ -360,6 +360,9 @@ bool DataReductionProxyParams::AreProxiesBypassed( |
if (retry_map.size() == 0) |
return false; |
+ if (min_retry_delay != NULL) |
+ *min_retry_delay = base::TimeDelta::Max(); |
+ |
if (is_https && alt_allowed_) { |
return ArePrimaryAndFallbackBypassed( |
retry_map, ssl_origin_, GURL(), min_retry_delay); |
@@ -387,29 +390,26 @@ bool DataReductionProxyParams::ArePrimaryAndFallbackBypassed( |
net::ProxyServer(primary.SchemeIs(url::kHttpsScheme) ? |
net::ProxyServer::SCHEME_HTTPS : net::ProxyServer::SCHEME_HTTP, |
net::HostPortPair::FromURL(primary)).ToURI()); |
- |
- if (found == retry_map.end()) |
- return false; |
- |
- base::TimeDelta min_delay = found->second.current_delay; |
- if (!fallback_allowed_ || !fallback.is_valid()) { |
- if (min_retry_delay != NULL) |
- *min_retry_delay = min_delay; |
- return true; |
+ if (found != retry_map.end() && |
+ min_retry_delay != NULL && |
+ *min_retry_delay > found->second.current_delay) { |
+ *min_retry_delay = found->second.current_delay; |
} |
- found = retry_map.find( |
- net::ProxyServer(fallback.SchemeIs(url::kHttpsScheme) ? |
- net::ProxyServer::SCHEME_HTTPS : net::ProxyServer::SCHEME_HTTP, |
- net::HostPortPair::FromURL(fallback)).ToURI()); |
+ if (fallback_allowed_ && fallback.is_valid()) { |
+ found = retry_map.find( |
+ net::ProxyServer(fallback.SchemeIs(url::kHttpsScheme) ? |
+ net::ProxyServer::SCHEME_HTTPS : net::ProxyServer::SCHEME_HTTP, |
+ net::HostPortPair::FromURL(fallback)).ToURI()); |
+ if (found != retry_map.end() && |
+ min_retry_delay != NULL && |
+ *min_retry_delay > found->second.current_delay) { |
+ *min_retry_delay = found->second.current_delay; |
+ } |
+ } |
if (found == retry_map.end()) |
return false; |
- |
- if (min_delay > found->second.current_delay) |
- min_delay = found->second.current_delay; |
- if (min_retry_delay != NULL) |
- *min_retry_delay = min_delay; |
return true; |
} |