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

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

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 DCHECK 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.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h
index 90cbecc90615f58c24a76ec109d111ee0a28e299..549ccb8c695d28bf3094ebdf1adaf308d2efeeb8 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h
@@ -27,6 +27,7 @@ class Value;
}
namespace data_reduction_proxy {
+class DataReductionProxyService;
// Data reduction proxy delayed pref service reduces the number calls to pref
// service by storing prefs in memory and writing to the given PrefService after
@@ -35,15 +36,20 @@ namespace data_reduction_proxy {
// prefs must be stored and read on the UI thread.
class DataReductionProxyCompressionStats {
public:
- // Constructs a data reduction proxy delayed pref service object using
- // |pref_service|. Writes prefs to |pref_service| after |delay|
- // and stores them in |pref_map_| and |list_pref_map| between writes.
+ // Collects and store data usage and compression statistics. Basic data usage
+ // stats are stored in browser preferences. More detailed stats broken down
+ // by site and internet type are stored in |DataReductionProxyStore|.
+ //
+ // To store basic stats, it constructs a data reduction proxy delayed pref
+ // service object using |pref_service|. Writes prefs to |pref_service| after
+ // |delay| and stores them in |pref_map_| and |list_pref_map| between writes.
// If |delay| is zero, writes directly to the PrefService and does not store
// in the maps.
DataReductionProxyCompressionStats(
+ DataReductionProxyService* service,
PrefService* pref_service,
- scoped_refptr<base::SequencedTaskRunner> task_runner,
- const base::TimeDelta& delay);
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner,
+ base::TimeDelta delay);
~DataReductionProxyCompressionStats();
// Records daily data savings statistics to prefs and reports data savings
@@ -140,6 +146,7 @@ class DataReductionProxyCompressionStats {
// are displayed to users as their data savings.
void RecordUserVisibleDataSavings();
+ DataReductionProxyService* service_;
PrefService* pref_service_;
scoped_refptr<base::SequencedTaskRunner> task_runner_;
const base::TimeDelta delay_;

Powered by Google App Engine
This is Rietveld 408576698