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

Unified Diff: net/nqe/network_quality_estimator.cc

Issue 2672733002: Read NQE prefs to network quality store under all cases (Closed)
Patch Set: ps Created 3 years, 11 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 | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_params.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.cc
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index cf364b5fe13f64a5badffc7d4bc6edd048aed4cd..140a09a2ffb752012c963a3d34da048ecdb82043 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -289,6 +289,8 @@ NetworkQualityEstimator::NetworkQualityEstimator(
variation_params)),
forced_effective_connection_type_(
nqe::internal::forced_effective_connection_type(variation_params)),
+ persistent_cache_reading_enabled_(
+ nqe::internal::persistent_cache_reading_enabled(variation_params)),
event_creator_(net_log),
weak_ptr_factory_(this) {
// None of the algorithms can have an empty name.
@@ -1406,6 +1408,9 @@ nqe::internal::NetworkID NetworkQualityEstimator::GetCurrentNetworkID() const {
bool NetworkQualityEstimator::ReadCachedNetworkQualityEstimate() {
DCHECK(thread_checker_.CalledOnValidThread());
+ if (!persistent_cache_reading_enabled_)
+ return false;
+
nqe::internal::CachedNetworkQuality cached_network_quality;
const bool cached_estimate_available = network_quality_store_->GetById(
@@ -1695,6 +1700,9 @@ void NetworkQualityEstimator::MaybeUpdateNetworkQualityFromCache(
const nqe::internal::NetworkID& network_id,
const nqe::internal::CachedNetworkQuality& cached_network_quality) {
DCHECK(thread_checker_.CalledOnValidThread());
+
+ if (!persistent_cache_reading_enabled_)
+ return;
if (network_id != current_network_id_)
return;
« no previous file with comments | « net/nqe/network_quality_estimator.h ('k') | net/nqe/network_quality_estimator_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698