Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG _H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG _H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG _H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG _H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, | 247 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, |
| 248 AreProxiesBypassedRetryDelay); | 248 AreProxiesBypassedRetryDelay); |
| 249 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiParams); | 249 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiParams); |
| 250 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiMissingParams); | 250 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiMissingParams); |
| 251 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, | 251 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, |
| 252 AutoLoFiParamsSlowConnectionsFlag); | 252 AutoLoFiParamsSlowConnectionsFlag); |
| 253 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, LoFiAccuracy); | 253 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, LoFiAccuracy); |
| 254 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, | 254 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, |
| 255 LoFiAccuracyNonZeroDelay); | 255 LoFiAccuracyNonZeroDelay); |
| 256 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, WarmupURL); | 256 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, WarmupURL); |
| 257 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, | |
| 258 ShouldAcceptServerLoFi); | |
| 259 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, ShouldAcceptLitePages); | |
| 257 | 260 |
| 258 // Values of the estimated network quality at the beginning of the most | 261 // Values of the estimated network quality at the beginning of the most |
| 259 // recent query of the Network Quality Estimator. | 262 // recent query of the Network Quality Estimator. |
| 260 enum NetworkQualityAtLastQuery { | 263 enum NetworkQualityAtLastQuery { |
| 261 NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN, | 264 NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN, |
| 262 NETWORK_QUALITY_AT_LAST_QUERY_SLOW, | 265 NETWORK_QUALITY_AT_LAST_QUERY_SLOW, |
| 263 NETWORK_QUALITY_AT_LAST_QUERY_NOT_SLOW | 266 NETWORK_QUALITY_AT_LAST_QUERY_NOT_SLOW |
| 264 }; | 267 }; |
| 265 | 268 |
| 266 // NetworkChangeNotifier::IPAddressObserver: | 269 // NetworkChangeNotifier::IPAddressObserver: |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 293 // proxies are bypassed, returns the minimum retry delay of the bypassed data | 296 // proxies are bypassed, returns the minimum retry delay of the bypassed data |
| 294 // reduction proxies in min_retry_delay (if not NULL). If there are no | 297 // reduction proxies in min_retry_delay (if not NULL). If there are no |
| 295 // bypassed data reduction proxies for the request scheme, returns false and | 298 // bypassed data reduction proxies for the request scheme, returns false and |
| 296 // does not assign min_retry_delay. | 299 // does not assign min_retry_delay. |
| 297 bool AreProxiesBypassed( | 300 bool AreProxiesBypassed( |
| 298 const net::ProxyRetryInfoMap& retry_map, | 301 const net::ProxyRetryInfoMap& retry_map, |
| 299 const net::ProxyConfig::ProxyRules& proxy_rules, | 302 const net::ProxyConfig::ProxyRules& proxy_rules, |
| 300 bool is_https, | 303 bool is_https, |
| 301 base::TimeDelta* min_retry_delay) const; | 304 base::TimeDelta* min_retry_delay) const; |
| 302 | 305 |
| 306 // Returns whether the client should report to the data reduction proxy that | |
| 307 // it is will to accept the Server Lo-Fi optimization for |request|. | |
|
bengr
2017/05/19 20:20:47
will -> willing
dougarnett
2017/05/19 21:43:58
Done.
| |
| 308 // |previews_decider| is a non-null object that determines eligibility of the | |
|
bengr
2017/05/19 20:20:47
I can't parse this sentence.
dougarnett
2017/05/19 21:43:58
Yeah, not my wording, I lifted this exact wording
dougarnett
2017/05/19 22:41:22
Tried to clarify this wording now.
| |
| 309 // showing the preview based on past opt outs. | |
| 310 // Should only be used if kDataReductionProxyDecidesTransform feature enabled. | |
|
bengr
2017/05/19 20:20:47
feature -> feature is
dougarnett
2017/05/19 21:43:58
Done.
| |
| 311 bool ShouldAcceptServerLoFi(const net::URLRequest& request, | |
| 312 previews::PreviewsDecider* previews_decider); | |
| 313 | |
| 314 // Returns whether the client should report to the data reduction proxy that | |
| 315 // it is will to accept a LitePage optimization for |request|. | |
|
bengr
2017/05/19 20:20:47
will -> willing
dougarnett
2017/05/19 21:43:58
Done.
| |
| 316 // |previews_decider| is a non-null object that determines eligibility of the | |
|
bengr
2017/05/19 20:20:47
I can't parse.
dougarnett
2017/05/19 21:43:58
ditto
| |
| 317 // showing the preview based on past opt outs. | |
| 318 // Should only be used if kDataReductionProxyDecidesTransform feature enabled. | |
|
bengr
2017/05/19 20:20:47
feature -> feature is
dougarnett
2017/05/19 21:43:58
Done.
| |
| 319 bool ShouldAcceptLitePages(const net::URLRequest& request, | |
| 320 previews::PreviewsDecider* previews_decider); | |
| 321 | |
| 303 // Returns true when Lo-Fi Previews should be activated. Determines if Lo-Fi | 322 // Returns true when Lo-Fi Previews should be activated. Determines if Lo-Fi |
| 304 // Previews should be activated by checking the Lo-Fi flags and if the network | 323 // Previews should be activated by checking the Lo-Fi flags and if the network |
| 305 // quality is prohibitively slow. |network_quality_estimator| may be NULL. | 324 // quality is prohibitively slow. |network_quality_estimator| may be NULL. |
| 306 // |previews_decider| is a non-null object that determines eligibility of the | 325 // |previews_decider| is a non-null object that determines eligibility of the |
| 307 // showing the preview based on past opt outs. | 326 // showing the preview based on past opt outs. |
| 327 // Should NOT be used if kDataReductionProxyDecidesTransform feature enabled. | |
|
bengr
2017/05/19 20:20:47
if -> if the
feature -> feature is
dougarnett
2017/05/19 21:43:58
Done.
| |
| 308 bool ShouldEnableLoFiInternal(const net::URLRequest& request, | 328 bool ShouldEnableLoFiInternal(const net::URLRequest& request, |
| 309 previews::PreviewsDecider* previews_decider); | 329 previews::PreviewsDecider* previews_decider); |
| 310 | 330 |
| 311 // Returns true when Lite Page Previews should be activated. Determines if | 331 // Returns true when Lite Page Previews should be activated. Determines if |
| 312 // Lite Page Previewsmode should be activated by checking the Lite Page | 332 // Lite Page Previewsmode should be activated by checking the Lite Page |
| 313 // Previews flags and if the network quality is prohibitively slow. | 333 // Previews flags and if the network quality is prohibitively slow. |
| 314 // |network_quality_estimator| may be NULL. |previews_decider| is a non-null | 334 // |network_quality_estimator| may be NULL. |previews_decider| is a non-null |
| 315 // object that determines eligibility of showing the preview based on past opt | 335 // object that determines eligibility of showing the preview based on past opt |
| 316 // outs. | 336 // outs. |
| 337 // Should NOT be used if kDataReductionProxyDecidesTransform feature enabled. | |
|
bengr
2017/05/19 20:20:47
Add 'the' and 'is'
dougarnett
2017/05/19 21:43:58
Done.
| |
| 317 bool ShouldEnableLitePagesInternal( | 338 bool ShouldEnableLitePagesInternal( |
| 318 const net::URLRequest& request, | 339 const net::URLRequest& request, |
| 319 previews::PreviewsDecider* previews_decider); | 340 previews::PreviewsDecider* previews_decider); |
| 320 | 341 |
| 321 // Returns true if the network quality is at least as poor as the one | 342 // Returns true if the network quality is at least as poor as the one |
| 322 // specified in the Auto Lo-Fi field trial parameters. | 343 // specified in the Auto Lo-Fi field trial parameters. |
| 323 // |network_quality_estimator| may be NULL. Virtualized for unit testing. | 344 // |network_quality_estimator| may be NULL. Virtualized for unit testing. |
| 324 virtual bool IsNetworkQualityProhibitivelySlow( | 345 virtual bool IsNetworkQualityProhibitivelySlow( |
| 325 const net::NetworkQualityEstimator* network_quality_estimator); | 346 const net::NetworkQualityEstimator* network_quality_estimator); |
| 326 | 347 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 bool is_captive_portal_; | 457 bool is_captive_portal_; |
| 437 | 458 |
| 438 base::WeakPtrFactory<DataReductionProxyConfig> weak_factory_; | 459 base::WeakPtrFactory<DataReductionProxyConfig> weak_factory_; |
| 439 | 460 |
| 440 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig); | 461 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig); |
| 441 }; | 462 }; |
| 442 | 463 |
| 443 } // namespace data_reduction_proxy | 464 } // namespace data_reduction_proxy |
| 444 | 465 |
| 445 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON FIG_H_ | 466 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON FIG_H_ |
| OLD | NEW |