Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h

Issue 2064193002: Use NQE's GetECT() API for data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nqe_connection_names
Patch Set: Rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
index 0358814d1c12139ffef1909043452fecd86c9b61..2a4c8ba34873f3f1dc9a7ca3e3afb4aef27780db 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
@@ -22,6 +22,7 @@
#include "net/base/network_change_notifier.h"
#include "net/base/network_interfaces.h"
#include "net/log/net_log.h"
+#include "net/nqe/network_quality_estimator.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_retry_info.h"
@@ -34,7 +35,6 @@ class SingleThreadTaskRunner;
namespace net {
class HostPortPair;
class NetLog;
-class NetworkQualityEstimator;
class URLFetcher;
class URLRequest;
class URLRequestContextGetter;
@@ -234,6 +234,7 @@ class DataReductionProxyConfig
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest,
AreProxiesBypassedRetryDelay);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiParams);
+ FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiMissingParams);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest,
AutoLoFiParamsSlowConnectionsFlag);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, LoFiAccuracy);
@@ -292,11 +293,9 @@ class DataReductionProxyConfig
bool ShouldEnableLoFiModeInternal(
const net::NetworkQualityEstimator* network_quality_estimator);
- // Returns true if expected throughput is lower than the one specified in the
- // Auto Lo-Fi field trial parameters OR if the expected round trip time is
- // higher than the one specified in the Auto Lo-Fi field trial parameters.
- // |network_quality_estimator| may be NULL.
- // Virtualized for unit testing.
+ // Returns true if the network quality is at least as poor as the one
+ // specified in the Auto Lo-Fi field trial parameters.
+ // |network_quality_estimator| may be NULL. Virtualized for unit testing.
virtual bool IsNetworkQualityProhibitivelySlow(
const net::NetworkQualityEstimator* network_quality_estimator);
@@ -308,6 +307,12 @@ class DataReductionProxyConfig
const net::NetworkQualityEstimator* network_quality_estimator,
const base::TimeDelta& measuring_duration) const;
+ // Returns true if |effective_connection_type| is at least as poor as
+ // |lofi_effective_connection_type_threshold_|.
+ bool IsEffectiveConnectionTypeSlowerThanThreshold(
+ net::NetworkQualityEstimator::EffectiveConnectionType
+ effective_connection_type) const;
+
std::unique_ptr<SecureProxyChecker> secure_proxy_checker_;
// Indicates if the secure Data Reduction Proxy can be used or not.
@@ -339,13 +344,10 @@ class DataReductionProxyConfig
base::ThreadChecker thread_checker_;
// Thresholds from the field trial at which auto Lo-Fi is turned on.
- // If the expected round trip time is higher than |auto_lofi_minimum_rtt_|,
- // auto Lo-Fi would be turned on.
- base::TimeDelta auto_lofi_minimum_rtt_;
-
- // If the expected throughput in Kbps is lower than
- // |auto_lofi_maximum_kbps_|, auto Lo-Fi would be turned on.
- int32_t auto_lofi_maximum_kbps_;
+ // If the effective connection type is at least as slow as
+ // |lofi_effective_connection_type_threshold_|, Lo-Fi would be turned on.
+ net::NetworkQualityEstimator::EffectiveConnectionType
+ lofi_effective_connection_type_threshold_;
// State of auto Lo-Fi is not changed more than once in any period of
// duration shorter than |auto_lofi_hysteresis_|.
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698