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

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

Issue 1127893002: Add DataReductionProxyExperimentsStats and UMA for measuring potentially non-compressed bytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failures Created 5 years, 7 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_service.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h
index 2fbc18d1577daa119cccd0a9131a6ef171b3a7b6..df2b38bc0ae71dfb10b31798319f5aec47a40a2d 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h
@@ -43,14 +43,16 @@ class DataReductionProxyService
: public base::NonThreadSafe,
public DataReductionProxyEventStorageDelegate {
public:
- // The caller must ensure that |settings| and |request_context| remain alive
- // for the lifetime of the |DataReductionProxyService| instance. This instance
+ // The caller must ensure that |settings|, |prefs|, |request_context|, and
+ // |io_task_runner| remain alive for the lifetime of the
+ // |DataReductionProxyService| instance. |prefs| may be null. This instance
// will take ownership of |compression_stats|.
// TODO(jeremyim): DataReductionProxyService should own
// DataReductionProxySettings and not vice versa.
DataReductionProxyService(
scoped_ptr<DataReductionProxyCompressionStats> compression_stats,
DataReductionProxySettings* settings,
+ PrefService* prefs,
net::URLRequestContextGetter* request_context_getter,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
@@ -89,6 +91,9 @@ class DataReductionProxyService
// Records whether the Data Reduction Proxy is unreachable or not.
void SetUnreachable(bool unreachable);
+ // Stores an int64 value in |prefs_|.
+ void SetInt64Pref(const std::string& pref_path, int64 value);
+
// Bridge methods to safely call to the UI thread objects.
// Virtual for testing.
virtual void SetProxyPrefs(bool enabled,
@@ -129,6 +134,9 @@ class DataReductionProxyService
DataReductionProxySettings* settings_;
+ // A prefs service for storing data.
+ PrefService* prefs_;
+
// Used to post tasks to |io_data_|.
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698