Chromium Code Reviews| 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 0ed7d1b386c3d349b91409ca857c29068d290f5c..bb25bb621d2de82d989aab801aad58081ec89f61 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 |
| @@ -26,6 +26,8 @@ class Value; |
| } |
| namespace data_reduction_proxy { |
| +class DataReductionProxyStore; |
| +class DataUsageStorageHelper; |
| // 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 |
| @@ -41,7 +43,9 @@ class DataReductionProxyCompressionStats { |
| // in the maps. |
| DataReductionProxyCompressionStats( |
| PrefService* pref_service, |
| - scoped_refptr<base::SequencedTaskRunner> task_runner, |
| + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| + scoped_refptr<base::SingleThreadTaskRunner> db_task_runner, |
| + scoped_refptr<DataReductionProxyStore> store, |
|
michaeln
2015/06/26 20:15:00
can these be passed by reference?
Not at Google. Contact bengr
2015/06/29 20:53:26
DataReductionProxyStore is meant to be a common st
michaeln
2015/06/29 23:19:30
i meant pass the scoper by reference:
const sc
Not at Google. Contact bengr
2015/07/01 17:13:48
Ah! Fixed.
|
| const base::TimeDelta& delay); |
|
michaeln
2015/06/26 20:15:00
no real reason to pass TimeDeltas by reference (th
Not at Google. Contact bengr
2015/06/29 20:53:26
Existing code. Done.
|
| ~DataReductionProxyCompressionStats(); |
| @@ -84,6 +88,9 @@ class DataReductionProxyCompressionStats { |
| typedef base::ScopedPtrHashMap<const char*, scoped_ptr<base::ListValue>> |
| DataReductionProxyListPrefMap; |
| + // Initializes data usage store. |
| + void InitOnDBThread(); |
| + |
| // Loads all data_reduction_proxy::prefs into the |pref_map_| and |
| // |list_pref_map_|. |
| void Init(); |
| @@ -138,7 +145,9 @@ class DataReductionProxyCompressionStats { |
| void RecordUserVisibleDataSavings(); |
| PrefService* pref_service_; |
| - scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| + scoped_refptr<base::SingleThreadTaskRunner> db_task_runner_; |
| + scoped_refptr<DataUsageStorageHelper> data_usage_store_; |
| const base::TimeDelta delay_; |
| bool delayed_task_posted_; |
| DataReductionProxyPrefMap pref_map_; |
| @@ -147,7 +156,6 @@ class DataReductionProxyCompressionStats { |
| base::ThreadChecker thread_checker_; |
| base::WeakPtrFactory<DataReductionProxyCompressionStats> weak_factory_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(DataReductionProxyCompressionStats); |
| }; |