| 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 1b28d5d7143431b346983af40e954d722b8eca85..57247f600c6724c5ed9268d8fcaecba4436e9788 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
|
| @@ -143,6 +143,23 @@ void DataReductionProxyStatisticsPrefs::WritePrefs() {
|
| delayed_task_posted_ = false;
|
| }
|
|
|
| +base::Value*
|
| +DataReductionProxyStatisticsPrefs::HistoricNetworkStatsInfoToValue() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + int64 total_received = GetInt64(
|
| + data_reduction_proxy::prefs::kHttpReceivedContentLength);
|
| + int64 total_original = GetInt64(
|
| + data_reduction_proxy::prefs::kHttpOriginalContentLength);
|
| +
|
| + base::DictionaryValue* dict = new base::DictionaryValue();
|
| + // Use strings to avoid overflow. base::Value only supports 32-bit integers.
|
| + dict->SetString("historic_received_content_length",
|
| + base::Int64ToString(total_received));
|
| + dict->SetString("historic_original_content_length",
|
| + base::Int64ToString(total_original));
|
| + return dict;
|
| +}
|
| +
|
| void DataReductionProxyStatisticsPrefs::DelayedWritePrefs() {
|
| // Only write after the first time posting the task.
|
| if (delayed_task_posted_)
|
|
|