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

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

Issue 1173343009: LevelDB storage for data reduction proxy to store data usage stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 years, 6 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 0ed7d1b386c3d349b91409ca857c29068d290f5c..6deb9feb6c82b8542f36ed7065f02b9026c1a901 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,
const base::TimeDelta& delay);
~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,10 @@ 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<DataReductionProxyStore> store_;
+ scoped_ptr<DataUsageStorageHelper> data_usage_store_;
const base::TimeDelta delay_;
bool delayed_task_posted_;
DataReductionProxyPrefMap pref_map_;

Powered by Google App Engine
This is Rietveld 408576698