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

Unified Diff: chrome/browser/net/nqe/ui_network_quality_estimator_service.cc

Issue 2622663002: NetworkQualityEstimator: Enable prefs writing by default (Closed)
Patch Set: Fix moar tests 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 | « no previous file | chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
diff --git a/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc b/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
index d0aada131d3fd13aa17ae48a3d19c09dd4db8db3..09b3d3397c6d87d3cb83314c096bfd2b42565007 100644
--- a/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
+++ b/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
@@ -43,14 +43,20 @@ std::string GetStringValueForVariationParamWithDefaultValue(
// trial.
bool persistent_cache_writing_enabled() {
return GetStringValueForVariationParamWithDefaultValue(
- "persistent_cache_writing_enabled", "false") == "true";
+ "persistent_cache_writing_enabled", "true") == "true";
}
// Returns true if reading from the persistent cache has been enabled via field
// trial.
bool persistent_cache_reading_enabled() {
- return GetStringValueForVariationParamWithDefaultValue(
- "persistent_cache_reading_enabled", "false") == "true";
+ if (GetStringValueForVariationParamWithDefaultValue(
+ "persistent_cache_reading_enabled", "false") != "true") {
+ return false;
+ }
+ // If reading from prefs is enabled, then writing to prefs must be enabled
+ // too.
+ DCHECK(persistent_cache_writing_enabled());
+ return true;
}
// PrefDelegateImpl writes the provided dictionary value to the network quality
@@ -71,14 +77,14 @@ class PrefDelegateImpl
return;
pref_service_->Set(path_, value);
- UMA_HISTOGRAM_COUNTS_1000("NQE.Prefs.WriteCount", 1);
+ UMA_HISTOGRAM_EXACT_LINEAR("NQE.Prefs.WriteCount", 1, 2);
}
std::unique_ptr<base::DictionaryValue> GetDictionaryValue() override {
DCHECK(thread_checker_.CalledOnValidThread());
if (!persistent_cache_reading_enabled())
return base::WrapUnique(new base::DictionaryValue());
- UMA_HISTOGRAM_COUNTS_1000("NQE.Prefs.ReadCount", 1);
+ UMA_HISTOGRAM_EXACT_LINEAR("NQE.Prefs.ReadCount", 1, 2);
return pref_service_->GetDictionary(path_)->CreateDeepCopy();
}
« no previous file with comments | « no previous file | chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698