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

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: Use raw pointers for arguments instead of ref counting 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..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);
};

Powered by Google App Engine
This is Rietveld 408576698