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

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

Issue 778463002: Wrapped data reduction proxy initialization into its own class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@network-delegate
Patch Set: Updated test 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_network_delegate.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h
index 0744b86c466fe82822b6ef2d63c7a9e5cedf7a1b..7da1858ef63517d71f4d1cfea652e00714d19c8a 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h
@@ -38,6 +38,7 @@ class URLRequest;
namespace data_reduction_proxy {
class DataReductionProxyAuthRequestHandler;
+class DataReductionProxyConfigurator;
class DataReductionProxyParams;
class DataReductionProxyStatisticsPrefs;
class DataReductionProxyUsageStats;
@@ -46,20 +47,6 @@ class DataReductionProxyUsageStats;
// NetworkDelegate and adds Data Reduction Proxy specific logic.
class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
public:
- // Provides an opportunity to interpose on proxy resolution. Called before
- // ProxyService.ResolveProxy() returns. The Data Reduction Proxy's
- // configuration is provided along with the resolution for this URL, in
- // |result|, whch may be modified. Retry info is presumed to be from the proxy
- // service.
- // TODO(sclittle): Remove this, see http://crbug.com/447346.
- typedef base::Callback<void(
- const GURL& url,
- int load_flags,
- const net::ProxyConfig& data_reduction_proxy_config,
- const net::ProxyRetryInfoMap& proxy_retry_info_map,
- const DataReductionProxyParams* params,
- net::ProxyInfo* result)> OnResolveProxyHandler;
-
// Provides an additional proxy configuration that can be consulted after
// proxy resolution. Used to get the Data Reduction Proxy config and give it
// to the OnResolveProxyHandler and RecordBytesHistograms.
@@ -74,13 +61,9 @@ class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
scoped_ptr<net::NetworkDelegate> network_delegate,
DataReductionProxyParams* params,
DataReductionProxyAuthRequestHandler* handler,
- const ProxyConfigGetter& getter);
+ const DataReductionProxyConfigurator* configurator);
~DataReductionProxyNetworkDelegate() override;
- // Initializes member variables used for overriding the proxy config.
- // |proxy_config_getter_| must be non-NULL when this is called.
- void InitProxyConfigOverrider(const OnResolveProxyHandler& proxy_handler);
-
// Initializes member variables to record data reduction proxy prefs and
// report UMA.
void InitStatisticsPrefsAndUMA(
@@ -159,10 +142,7 @@ class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
DataReductionProxyStatisticsPrefs* data_reduction_proxy_statistics_prefs_;
- // TODO(sclittle): Factor this out, see http://crbug.com/447346.
- OnResolveProxyHandler on_resolve_proxy_handler_;
-
- ProxyConfigGetter proxy_config_getter_;
+ const DataReductionProxyConfigurator* configurator_;
DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698