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

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

Issue 1680893002: Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate for DataReductionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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_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 873ece2900bb65c0017f5d19091c96c1c6fd9938..5bcf2a701af1b0231adf91a58f5fb394446dfdf5 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
@@ -18,35 +18,33 @@
class GURL;
namespace base {
class Value;
}
namespace net {
class HttpResponseHeaders;
class HttpRequestHeaders;
-class NetLog;
class NetworkDelegate;
class ProxyConfig;
class ProxyInfo;
class ProxyServer;
class ProxyService;
class URLRequest;
}
namespace data_reduction_proxy {
class DataReductionProxyBypassStats;
class DataReductionProxyConfig;
class DataReductionProxyConfigurator;
-class DataReductionProxyEventCreator;
class DataReductionProxyExperimentsStats;
class DataReductionProxyIOData;
class DataReductionProxyRequestOptions;
// Values of the UMA DataReductionProxy.LoFi.TransformationType histogram.
// This enum must remain synchronized with
// DataReductionProxyLoFiTransformationType in
// metrics/histograms/histograms.xml.
enum LoFiTransformationType {
PREVIEW = 0,
@@ -57,61 +55,44 @@ enum LoFiTransformationType {
// DataReductionProxyNetworkDelegate is a LayeredNetworkDelegate that wraps a
// NetworkDelegate and adds Data Reduction Proxy specific logic.
class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
public:
// 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.
typedef base::Callback<const net::ProxyConfig&()> ProxyConfigGetter;
// Constructs a DataReductionProxyNetworkdelegate object with the given
bengr 2016/02/08 23:23:29 DataReductionProxyNetworkdelegate -> DataReduction
RyanSturm 2016/02/09 00:46:03 Done.
- // |network_delegate|, |config|, |handler|, |configurator|,
- // |experiments_stats|, |net_log|, and |event_creator|. Takes ownership of
+ // |network_delegate|, |config|, |handler|, |configurator|, and
+ // |experiments_stats|. Takes ownership of
// and wraps the |network_delegate|, calling an internal implementation for
// each delegate method. For example, the implementation of
// OnHeadersReceived() calls OnHeadersReceivedInternal().
DataReductionProxyNetworkDelegate(
scoped_ptr<net::NetworkDelegate> network_delegate,
DataReductionProxyConfig* config,
DataReductionProxyRequestOptions* handler,
const DataReductionProxyConfigurator* configurator,
- DataReductionProxyExperimentsStats* experiments_stats,
- net::NetLog* net_log,
- DataReductionProxyEventCreator* event_creator);
+ DataReductionProxyExperimentsStats* experiments_stats);
~DataReductionProxyNetworkDelegate() override;
// Initializes member variables to record data reduction proxy prefs and
// report UMA.
void InitIODataAndUMA(
DataReductionProxyIOData* io_data,
DataReductionProxyBypassStats* bypass_stats);
// Creates a |Value| summary of the state of the network session. The caller
// is responsible for deleting the returned value.
base::Value* SessionNetworkStatsInfoToValue() const;
private:
- // Called as the proxy is being resolved for |url|. Allows the delegate to
- // override the proxy resolution decision made by ProxyService. The delegate
- // may override the decision by modifying the ProxyInfo |result|.
- void OnResolveProxyInternal(const GURL& url,
- int load_flags,
- const net::ProxyService& proxy_service,
- net::ProxyInfo* result) override;
-
- // Called when use of |bad_proxy| fails due to |net_error|. |net_error| is
- // the network error encountered, if any, and OK if the fallback was
- // for a reason other than a network error (e.g. the proxy service was
- // explicitly directed to skip a proxy).
- void OnProxyFallbackInternal(const net::ProxyServer& bad_proxy,
- int net_error) override;
-
// Called after a proxy connection. Allows the delegate to read/write
// |headers| before they get sent out. |headers| is valid only until
// OnCompleted or OnURLRequestDestroyed is called for this request.
void OnBeforeSendProxyHeadersInternal(
net::URLRequest* request,
const net::ProxyInfo& proxy_info,
net::HttpRequestHeaders* headers) override;
// Indicates that the URL request has been completed or failed.
// |started| indicates whether the request has been started. If false,
@@ -160,33 +141,15 @@ class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
DataReductionProxyBypassStats* data_reduction_proxy_bypass_stats_;
DataReductionProxyRequestOptions* data_reduction_proxy_request_options_;
DataReductionProxyIOData* data_reduction_proxy_io_data_;
const DataReductionProxyConfigurator* configurator_;
DataReductionProxyExperimentsStats* experiments_stats_;
- net::NetLog* net_log_;
-
- DataReductionProxyEventCreator* event_creator_;
-
DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate);
};
-
-// Adds data reduction proxies to |result|, where applicable, if result
-// otherwise uses a direct connection for |url|, and the data reduction proxy is
-// not bypassed. Also, configures |result| to proceed directly to the origin if
-// |result|'s current proxy is the data reduction proxy, the
-// |net::LOAD_BYPASS_DATA_REDUCTION_PROXY| |load_flag| is set, and the
-// DataCompressionProxyCriticalBypass Finch trial is set.
-void OnResolveProxyHandler(const GURL& url,
- int load_flags,
- const net::ProxyConfig& data_reduction_proxy_config,
- const net::ProxyRetryInfoMap& proxy_retry_info,
- const DataReductionProxyConfig* config,
- net::ProxyInfo* result);
-
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWORK_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698