Index: components/data_reduction_proxy/browser/data_reduction_proxy_params.h |
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_params.h b/components/data_reduction_proxy/browser/data_reduction_proxy_params.h |
index fbcc394d0358b2bfa1e93a44a4f1be4e452c97c1..ae024b8063e2dd1515622e97a6cfda3808136eaf 100644 |
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_params.h |
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_params.h |
@@ -11,8 +11,13 @@ |
#include "base/macros.h" |
#include "net/base/host_port_pair.h" |
+#include "net/proxy/proxy_retry_info.h" |
#include "url/gurl.h" |
+namespace base { |
+class TimeDelta; |
+} |
+ |
namespace net { |
class URLRequest; |
} |
@@ -104,6 +109,25 @@ class DataReductionProxyParams { |
// list. |
virtual bool IsDataReductionProxyEligible(const net::URLRequest* request); |
+ // Checks if all configured data reduction proxies are in the retry map. |
+ // Returns true if the request is bypassed by all configured data reduction |
+ // proxies and returns the bypass delay in delay_seconds (if not NULL). If |
+ // there are no configured data reduction proxies, returns false. If |
+ // the request is bypassed by more than one proxy, delay_seconds returns |
+ // the shortest delay. |
+ bool AreDataReductionProxiesBypassed(const net::URLRequest& request, |
+ base::TimeDelta* min_retry_delay) const; |
+ |
+ // Checks if all configured data reduction proxies are in the retry map. |
+ // Returns true if the request is bypassed by all configured data reduction |
+ // proxies and returns the bypass delay in delay_seconds (if not NULL). If |
+ // there are no configured data reduction proxies, returns false. If |
+ // the request is bypassed by more than one proxy, delay_seconds returns |
+ // the shortest delay. |
+ bool AreProxiesBypassed(const net::ProxyRetryInfoMap& retry_map, |
+ bool is_https, |
+ base::TimeDelta* min_retry_delay) const; |
+ |
// Returns the data reduction proxy primary origin. |
const GURL& origin() const { |
return origin_; |
@@ -204,6 +228,15 @@ class DataReductionProxyParams { |
virtual std::string GetDefaultWarmupURL() const; |
private: |
+ // Checks if the primary and fallback data reduction proxies are in the retry |
+ // map. Returns true if the request is bypassed by both data reduction |
+ // proxies and returns the shortest bypass delay in delay_seconds (if not |
+ // NULL). If the fallback proxy is not valid, returns true if primary proxy |
+ // was bypassed and returns its bypass delay. |
+ bool ArePrimaryAndFallbackBypassed(const net::ProxyRetryInfoMap& retry_map, |
+ const GURL& primary, |
+ const GURL& fallback, |
+ base::TimeDelta* min_retry_delay) const; |
GURL origin_; |
GURL fallback_origin_; |
GURL ssl_origin_; |