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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.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_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 b679892786388bc5e0c0d160b4edac7ced4432b3..a043f43184124eb6b8ce40850cb7b772c95e192d 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,6 +6,7 @@
#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"
@@ -30,14 +31,12 @@ class DataReductionProxyUsageStats;
class DataReductionProxyIOData {
public:
// Constructs a DataReductionProxyIOData object and takes ownership of
- // |params| and |statistics_prefs|. |params| contains information about the
- // DNS names used by the proxy, and allowable configurations.
- // |statistics_prefs| maintains compression statistics during use of the
- // proxy. |settings| provides a UI hook to signal when the proxy is
- // unavailable. Only |statistics_prefs.get()| may be null.
+ // |params|. |params| contains information about the DNS names used by the
+ // proxy, and allowable configurations. |settings| provides a UI hook to
+ // signal when the proxy is unavailable. Only |statistics_prefs.get()| may be
+ // null.
DataReductionProxyIOData(
const Client& client,
- scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs,
DataReductionProxySettings* settings,
net::NetLog* net_log,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
@@ -106,7 +105,7 @@ class DataReductionProxyIOData {
scoped_ptr<DataReductionProxyParams> params_;
// Tracker of compression statistics to be displayed to the user.
- scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs_;
+ base::WeakPtr<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