Chromium Code Reviews| 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_; |