| 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();
|
| }
|
|
|
|
|