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

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

Issue 893003002: Data Reduction Proxy class ownership updates and Settings cleanup (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 b679892786388bc5e0c0d160b4edac7ced4432b3..428c529998635c0e19dba791a513e014de178858 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
@@ -13,14 +13,15 @@
namespace net {
class NetLog;
+class URLRequestContextGetter;
class URLRequestInterceptor;
}
namespace data_reduction_proxy {
+class DataReductionProxyConfig;
class DataReductionProxyConfigurator;
class DataReductionProxyEventStore;
-class DataReductionProxyParams;
class DataReductionProxySettings;
class DataReductionProxyStatisticsPrefs;
class DataReductionProxyUsageStats;
@@ -30,13 +31,14 @@ 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|. |param_flags| is used to construct 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.
DataReductionProxyIOData(
const Client& client,
+ int param_flags,
scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs,
DataReductionProxySettings* settings,
net::NetLog* net_log,
@@ -45,6 +47,14 @@ class DataReductionProxyIOData {
virtual ~DataReductionProxyIOData();
+ // |context| cannot be passed in in the constructor; in Chromium, the
+ // URLRequestContextGetter is obtained from the Profile, but
+ // DataReductionProxyIOData needs to be created before ProfileImplIOData
+ // can be used (since the Data Reduction Proxy network delegate is
+ // injected in ProfileImplIOData::InitializeInternal but comes off of
+ // DataReductionProxyIOData).
+ void Initialize(net::URLRequestContextGetter* context);
+
// Initializes preferences, including a preference to track whether the
// Data Reduction Proxy is enabled.
void InitOnUIThread(PrefService* pref_service);
@@ -73,37 +83,32 @@ class DataReductionProxyIOData {
// Returns true if the Data Reduction Proxy is enabled and false otherwise.
bool IsEnabled() const;
- DataReductionProxyConfigurator* configurator() const {
- return configurator_.get();
- }
+ virtual DataReductionProxyConfig* config() const;
bengr 2015/02/05 00:46:02 Why did these all become virtuals?
jeremyim 2015/02/05 00:59:52 Done.
+
+ virtual DataReductionProxyConfigurator* configurator() const;
- DataReductionProxyEventStore* event_store() const {
- return event_store_.get();
- }
+ virtual DataReductionProxyEventStore* event_store() const;
- DataReductionProxyStatisticsPrefs* statistics_prefs() const {
- return statistics_prefs_.get();
- }
+ virtual DataReductionProxyStatisticsPrefs* statistics_prefs() const;
- net::ProxyDelegate* proxy_delegate() const {
- return proxy_delegate_.get();
- }
+ virtual net::ProxyDelegate* proxy_delegate() const;
- net::NetLog* net_log() {
- return net_log_;
- }
+ virtual net::NetLog* net_log();
// Used for testing.
- DataReductionProxyUsageStats* usage_stats() const {
- return usage_stats_.get();
- }
+ virtual DataReductionProxyUsageStats* usage_stats() const;
private:
+ friend class TestDataReductionProxyIOData;
+
+ // Used for testing.
+ DataReductionProxyIOData();
+
// The type of Data Reduction Proxy client.
Client client_;
// Parameters including DNS names and allowable configurations.
- scoped_ptr<DataReductionProxyParams> params_;
+ scoped_ptr<DataReductionProxyConfig> config_;
// Tracker of compression statistics to be displayed to the user.
scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs_;

Powered by Google App Engine
This is Rietveld 408576698