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

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

Issue 896713003: Revert of DataReductionProxyStatisticsPrefs should support WeakPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_io_data.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
index ecbb0f065980ac03b43b56c8d8d55ee6b14e2cef..2eecb6a80eaf6da9895812d4cac8617620ff07a1 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
@@ -6,7 +6,6 @@
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_IO_DATA_H_
#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
#include "base/prefs/pref_member.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.h"
@@ -53,11 +52,11 @@
// Destroys the statistics preferences.
void ShutdownOnUIThread();
- void SetDataReductionProxyStatisticsPrefs(
- base::WeakPtr<DataReductionProxyStatisticsPrefs> statistics_prefs);
-
- // Passes ownership of |statistics_prefs_|.
- scoped_ptr<DataReductionProxyStatisticsPrefs> PassStatisticsPrefs();
+ // Constructs statistics prefs. This is not necessary if a valid statistics
+ // prefs is passed into the constructor.
+ void EnableCompressionStatisticsLogging(
+ PrefService* prefs,
+ const base::TimeDelta& commit_delay);
// Creates an interceptor suitable for following the Data Reduction Proxy
// bypass protocol.
@@ -80,6 +79,10 @@
DataReductionProxyEventStore* event_store() const {
return event_store_.get();
+ }
+
+ DataReductionProxyStatisticsPrefs* statistics_prefs() const {
+ return statistics_prefs_.get();
}
DataReductionProxyAuthRequestHandler* auth_request_handler() const {
@@ -107,10 +110,7 @@
scoped_ptr<DataReductionProxyParams> params_;
// Tracker of compression statistics to be displayed to the user.
- base::WeakPtr<DataReductionProxyStatisticsPrefs> statistics_prefs_;
- // |temporary_statistics_prefs_| is used only until DataReductionProxySettings
- // initialization and is dead after.
- scoped_ptr<DataReductionProxyStatisticsPrefs> temporary_statistics_prefs_;
+ scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs_;
// Tracker of Data Reduction Proxy-related events, e.g., for logging.
scoped_ptr<DataReductionProxyEventStore> event_store_;

Powered by Google App Engine
This is Rietveld 408576698