Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc |
index 57247f600c6724c5ed9268d8fcaecba4436e9788..92a62f824e1ea3147c6be291bde0a83e3a7d072b 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.cc |
@@ -5,6 +5,7 @@ |
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.h" |
#include "base/bind.h" |
+#include "base/command_line.h" |
#include "base/location.h" |
#include "base/logging.h" |
#include "base/prefs/pref_change_registrar.h" |
@@ -14,6 +15,7 @@ |
#include "base/strings/string_number_conversions.h" |
#include "base/time/time.h" |
#include "base/values.h" |
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h" |
namespace data_reduction_proxy { |
@@ -70,6 +72,33 @@ void DataReductionProxyStatisticsPrefs::Init() { |
InitListPref(data_reduction_proxy::prefs:: |
kDailyOriginalContentLengthWithDataReductionProxyEnabled); |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ data_reduction_proxy::switches::kClearDataReductionProxyDataSavings)) { |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
bengr
2015/03/16 22:54:17
Please move this to a function called ClearStatist
Not at Google. Contact bengr
2015/03/16 23:25:27
Done.
|
+ kDailyContentLengthHttpsWithDataReductionProxyEnabled)->Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyContentLengthLongBypassWithDataReductionProxyEnabled)->Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyContentLengthShortBypassWithDataReductionProxyEnabled)->Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyContentLengthUnknownWithDataReductionProxyEnabled)->Clear(); |
+ list_pref_map_.get( |
+ data_reduction_proxy::prefs::kDailyContentLengthViaDataReductionProxy)-> |
+ Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyContentLengthWithDataReductionProxyEnabled)->Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyHttpOriginalContentLength)->Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyHttpReceivedContentLength)->Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyOriginalContentLengthViaDataReductionProxy)->Clear(); |
+ list_pref_map_.get(data_reduction_proxy::prefs:: |
+ kDailyOriginalContentLengthWithDataReductionProxyEnabled)->Clear(); |
+ |
+ WritePrefs(); |
+ } |
+ |
pref_change_registrar_->Init(pref_service_); |
pref_change_registrar_->Add(prefs::kUpdateDailyReceivedContentLengths, |
base::Bind(&DataReductionProxyStatisticsPrefs::OnUpdateContentLengths, |