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

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: DRPSettings owns DRPStatisticsPrefs Created 5 years, 11 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 3608f97bd12acfecb88c28985f05aa4efe096733..8801c1ac3f349dfb07568f4c74e0efd055dcf6b5 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
@@ -112,10 +112,14 @@ class DataReductionProxySettings
net::NetLog* net_log,
DataReductionProxyEventStore* event_store);
- // Sets the |statistics_prefs_| to be used for data reduction proxy pref reads
- // and writes.
+ // Takes ownership of |statistics_prefs_|. |statistics_prefs| maintains
+ // compression statistics during use of the proxy.
void SetDataReductionProxyStatisticsPrefs(
- DataReductionProxyStatisticsPrefs* statistics_prefs);
+ scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs);
+
+ DataReductionProxyStatisticsPrefs* statistics_prefs() const {
+ return statistics_prefs_.get();
+ }
// Sets the |on_data_reduction_proxy_enabled_| callback and runs to register
// the DataReductionProxyEnabled synthetic field trial.
@@ -311,7 +315,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