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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc

Issue 1221663009: Expose API to store and load data usage stats from UI task runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Breakdown
Patch Set: Add missing Pass. Created 5 years, 5 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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc
index f272fd999af26c7f841be8920a2fd3135d417fb7..2da41a50359c4a590597c030e7100d1389e2e3b8 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc
@@ -4,6 +4,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h"
+#include <string>
#include <vector>
#include "base/basictypes.h"
@@ -302,8 +303,8 @@ class DailyDataSavingUpdate {
DataReductionProxyCompressionStats::DataReductionProxyCompressionStats(
PrefService* prefs,
- scoped_refptr<base::SequencedTaskRunner> task_runner,
- const base::TimeDelta& delay)
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner,
+ base::TimeDelta delay)
: pref_service_(prefs),
task_runner_(task_runner),
delay_(delay),
@@ -319,7 +320,6 @@ DataReductionProxyCompressionStats::~DataReductionProxyCompressionStats() {
DCHECK(thread_checker_.CalledOnValidThread());
WritePrefs();
pref_change_registrar_->RemoveAll();
- weak_factory_.InvalidateWeakPtrs();
}
void DataReductionProxyCompressionStats::Init() {
@@ -383,6 +383,8 @@ void DataReductionProxyCompressionStats::UpdateContentLengths(
SetInt64(data_reduction_proxy::prefs::kHttpOriginalContentLength,
total_original);
+ // TODO(kundaji): Collect data usage metrics broken down by site and store
+ // in |data_usage_store_|.
RecordContentLengthPrefs(
received_content_length,
original_content_length,

Powered by Google App Engine
This is Rietveld 408576698