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

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

Issue 888713002: DataReductionProxyStatisticsPrefs should support WeakPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Webview fix Created 5 years, 10 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_settings.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h
index 911668705fed33cf74bf7068c2e001c537e635ec..61539beb9cbda06e13a9aef866f5ebe7de79fe64 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h
@@ -36,6 +36,7 @@ class URLRequestContextGetter;
namespace data_reduction_proxy {
class DataReductionProxyEventStore;
+class DataReductionProxyStatisticsPrefs;
// The number of days of bandwidth usage statistics that are tracked.
const unsigned int kNumDaysInHistory = 60;
@@ -83,14 +84,19 @@ class DataReductionProxySettings
// |DataReductionProxySettings| instance.
void InitDataReductionProxySettings(
PrefService* prefs,
+ scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs,
net::URLRequestContextGetter* url_request_context_getter,
net::NetLog* net_log,
DataReductionProxyEventStore* event_store);
- // Sets the |statistics_prefs_| to be used for data reduction proxy pref reads
- // and writes.
- void SetDataReductionProxyStatisticsPrefs(
- DataReductionProxyStatisticsPrefs* statistics_prefs);
+ // Constructs statistics prefs. This should not be called if a valid
+ // statistics prefs is passed into the constructor.
+ void EnableCompressionStatisticsLogging(
+ PrefService* prefs,
+ scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
+ const base::TimeDelta& commit_delay);
+
+ base::WeakPtr<DataReductionProxyStatisticsPrefs> statistics_prefs();
// Sets the |on_data_reduction_proxy_enabled_| callback and runs to register
// the DataReductionProxyEnabled synthetic field trial.
@@ -163,6 +169,10 @@ class DataReductionProxySettings
return event_store_;
}
+ // Used for testing.
+ void SetDataReductionProxyStatisticsPrefs(
+ scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs);
+
protected:
void InitPrefMembers();
@@ -283,7 +293,7 @@ class DataReductionProxySettings
BooleanPrefMember data_reduction_proxy_alternative_enabled_;
PrefService* prefs_;
- DataReductionProxyStatisticsPrefs* statistics_prefs_;
+ scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs_;
net::URLRequestContextGetter* url_request_context_getter_;

Powered by Google App Engine
This is Rietveld 408576698