| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "net/base/host_port_pair.h" | 13 #include "net/base/host_port_pair.h" |
| 14 #include "net/proxy/proxy_retry_info.h" | 14 #include "net/proxy/proxy_retry_info.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class TimeDelta; | 18 class TimeDelta; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 class ProxyConfig; |
| 22 class URLRequest; | 23 class URLRequest; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace data_reduction_proxy { | 26 namespace data_reduction_proxy { |
| 26 | 27 |
| 27 // Contains information about a given proxy server. |proxy_servers| contains | 28 // Contains information about a given proxy server. |proxy_servers| contains |
| 28 // the configured data reduction proxy servers. |is_fallback|, |is_alternative| | 29 // the configured data reduction proxy servers. |is_fallback|, |is_alternative| |
| 29 // and |is_ssl| note whether the given proxy is a fallback, an alternative, | 30 // and |is_ssl| note whether the given proxy is a fallback, an alternative, |
| 30 // or a proxy for ssl; these are not mutually exclusive. | 31 // or a proxy for ssl; these are not mutually exclusive. |
| 31 struct DataReductionProxyTypeInfo { | 32 struct DataReductionProxyTypeInfo { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // if the caller isn't interested in its values. Virtual for testing. | 124 // if the caller isn't interested in its values. Virtual for testing. |
| 124 virtual bool IsDataReductionProxy( | 125 virtual bool IsDataReductionProxy( |
| 125 const net::HostPortPair& host_port_pair, | 126 const net::HostPortPair& host_port_pair, |
| 126 DataReductionProxyTypeInfo* proxy_info) const; | 127 DataReductionProxyTypeInfo* proxy_info) const; |
| 127 | 128 |
| 128 // Returns true if this request will be sent through the data request proxy | 129 // Returns true if this request will be sent through the data request proxy |
| 129 // based on applying the param rules to the URL. We do not check bad proxy | 130 // based on applying the param rules to the URL. We do not check bad proxy |
| 130 // list. | 131 // list. |
| 131 virtual bool IsDataReductionProxyEligible(const net::URLRequest* request); | 132 virtual bool IsDataReductionProxyEligible(const net::URLRequest* request); |
| 132 | 133 |
| 134 // Returns true if this request could be sent through the data request proxy |
| 135 // based on applying the |data_reduction_proxy_config| param rules to the |
| 136 // request URL. |
| 137 bool IsBypassedByDataReductionProxyLocalRules( |
| 138 const net::URLRequest& request, |
| 139 const net::ProxyConfig& data_reduction_proxy_config) const; |
| 140 |
| 133 // Checks if all configured data reduction proxies are in the retry map. | 141 // Checks if all configured data reduction proxies are in the retry map. |
| 134 // Returns true if the request is bypassed by all configured data reduction | 142 // Returns true if the request is bypassed by all configured data reduction |
| 135 // proxies and returns the bypass delay in delay_seconds (if not NULL). If | 143 // proxies and returns the bypass delay in delay_seconds (if not NULL). If |
| 136 // there are no configured data reduction proxies, returns false. If | 144 // there are no configured data reduction proxies, returns false. If |
| 137 // the request is bypassed by more than one proxy, delay_seconds returns | 145 // the request is bypassed by more than one proxy, delay_seconds returns |
| 138 // the shortest delay. | 146 // the shortest delay. |
| 139 bool AreDataReductionProxiesBypassed(const net::URLRequest& request, | 147 bool AreDataReductionProxiesBypassed(const net::URLRequest& request, |
| 140 base::TimeDelta* min_retry_delay) const; | 148 base::TimeDelta* min_retry_delay) const; |
| 141 | 149 |
| 142 // Checks if all configured data reduction proxies are in the retry map. | 150 // Checks if all configured data reduction proxies are in the retry map. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 bool fallback_allowed_; | 283 bool fallback_allowed_; |
| 276 bool alt_allowed_; | 284 bool alt_allowed_; |
| 277 bool promo_allowed_; | 285 bool promo_allowed_; |
| 278 bool holdback_; | 286 bool holdback_; |
| 279 | 287 |
| 280 bool configured_on_command_line_; | 288 bool configured_on_command_line_; |
| 281 }; | 289 }; |
| 282 | 290 |
| 283 } // namespace data_reduction_proxy | 291 } // namespace data_reduction_proxy |
| 284 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H
_ | 292 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H
_ |
| OLD | NEW |