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

Unified Diff: chrome/browser/net/chrome_network_delegate.h

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix Created 6 years 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: chrome/browser/net/chrome_network_delegate.h
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index ed0a939f27fa9be37ba4c2d03ebbb23c653a03a7..4635e57422fbc183b935b81887dafb9e515e2fed 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -14,8 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h"
-#include "net/base/network_delegate.h"
-#include "net/proxy/proxy_retry_info.h"
+#include "net/base/network_delegate_impl.h"
class ChromeExtensionsNetworkDelegate;
class ClientHints;
@@ -35,13 +34,6 @@ class ConnectInterceptor;
class Predictor;
}
-namespace data_reduction_proxy {
-class DataReductionProxyAuthRequestHandler;
-class DataReductionProxyParams;
-class DataReductionProxyStatisticsPrefs;
-class DataReductionProxyUsageStats;
-}
-
namespace domain_reliability {
class DomainReliabilityMonitor;
}
@@ -52,10 +44,6 @@ class InfoMap;
}
namespace net {
-class ProxyConfig;
-class ProxyInfo;
-class ProxyServer;
-class ProxyService;
class URLRequest;
}
@@ -69,26 +57,8 @@ class PrerenderTracker;
// ChromeNetworkDelegate is the central point from within the chrome code to
// add hooks into the network stack.
-class ChromeNetworkDelegate : public net::NetworkDelegate {
+class ChromeNetworkDelegate : public net::NetworkDelegateImpl {
public:
- // Provides an opportunity to interpose on proxy resolution. Called before
- // ProxyService.ResolveProxy() returns. Two proxy configurations are provided
- // that specify the data reduction proxy's configuration and the effective
- // configuration according to the proxy service, respectively. Retry info is
- // presumed to be from the proxy service.
- typedef base::Callback<void(
- const GURL& url,
- int load_flags,
- const net::ProxyConfig& data_reduction_proxy_config,
- const net::ProxyConfig& proxy_service_proxy_config,
- const net::ProxyRetryInfoMap& proxy_retry_info_map,
- const data_reduction_proxy::DataReductionProxyParams* params,
- net::ProxyInfo* result)> OnResolveProxyHandler;
-
- // Provides an additional proxy configuration that can be consulted after
- // proxy resolution.
- typedef base::Callback<const net::ProxyConfig&()> ProxyConfigGetter;
-
// |enable_referrers| (and all of the other optional PrefMembers) should be
// initialized on the UI thread (see below) beforehand. This object's owner is
// responsible for cleaning them up at shutdown.
@@ -146,11 +116,6 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
force_youtube_safety_mode_ = force_youtube_safety_mode;
}
- void set_data_reduction_proxy_enabled_pref(
- BooleanPrefMember* data_reduction_proxy_enabled) {
- data_reduction_proxy_enabled_ = data_reduction_proxy_enabled;
- }
-
void set_domain_reliability_monitor(
domain_reliability::DomainReliabilityMonitor* monitor) {
domain_reliability_monitor_ = monitor;
@@ -160,42 +125,6 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
prerender_tracker_ = prerender_tracker;
}
- // |data_reduction_proxy_params_| must outlive this ChromeNetworkDelegate.
- void set_data_reduction_proxy_params(
- data_reduction_proxy::DataReductionProxyParams* params) {
- data_reduction_proxy_params_ = params;
- }
-
- // |data_reduction_proxy_usage_stats_| must outlive this
- // ChromeNetworkDelegate.
- void set_data_reduction_proxy_usage_stats(
- data_reduction_proxy::DataReductionProxyUsageStats* usage_stats) {
- data_reduction_proxy_usage_stats_ = usage_stats;
- }
-
- // |data_reduction_proxy_auth_request_handler_| must outlive this
- // ChromeNetworkDelegate.
- void set_data_reduction_proxy_auth_request_handler(
- data_reduction_proxy::DataReductionProxyAuthRequestHandler* handler) {
- data_reduction_proxy_auth_request_handler_ = handler;
- }
-
- // |data_reduction_proxy_statistics_prefs_| must outlive this
- // ChromeNetworkDelegate.
- void set_data_reduction_proxy_statistics_prefs(
- data_reduction_proxy::DataReductionProxyStatisticsPrefs*
- statistics_prefs) {
- data_reduction_proxy_statistics_prefs_ = statistics_prefs;
- }
-
- void set_on_resolve_proxy_handler(OnResolveProxyHandler handler) {
- on_resolve_proxy_handler_ = handler;
- }
-
- void set_proxy_config_getter(const ProxyConfigGetter& getter) {
- proxy_config_getter_ = getter;
- }
-
// Adds the Client Hints header to HTTP requests.
void SetEnableClientHints();
@@ -218,15 +147,6 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
// called, then some platforms restrict access to file:// paths.
static void AllowAccessToAllFiles();
- // Creates a Value summary of the persistent state of the network session.
- // The caller is responsible for deleting the returned value.
- // Must be called on the UI thread.
- static base::Value* HistoricNetworkStatsInfoToValue(PrefService* prefs);
-
- // 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:
friend class ChromeNetworkDelegateTest;
@@ -234,18 +154,9 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
int OnBeforeURLRequest(net::URLRequest* request,
const net::CompletionCallback& callback,
GURL* new_url) override;
- void OnResolveProxy(const GURL& url,
- int load_flags,
- const net::ProxyService& proxy_service,
- net::ProxyInfo* result) override;
- void OnProxyFallback(const net::ProxyServer& bad_proxy,
- int net_error) override;
int OnBeforeSendHeaders(net::URLRequest* request,
const net::CompletionCallback& callback,
net::HttpRequestHeaders* headers) override;
- void OnBeforeSendProxyHeaders(net::URLRequest* request,
- const net::ProxyInfo& proxy_info,
- net::HttpRequestHeaders* headers) override;
void OnSendHeaders(net::URLRequest* request,
const net::HttpRequestHeaders& headers) override;
int OnHeadersReceived(
@@ -284,8 +195,7 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
void AccumulateContentLength(
int64 received_payload_byte_count,
- int64 original_payload_byte_count,
- data_reduction_proxy::DataReductionProxyRequestType request_type);
+ int64 original_payload_byte_count);
scoped_ptr<ChromeExtensionsNetworkDelegate> extensions_delegate_;
@@ -301,7 +211,6 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
BooleanPrefMember* force_safe_search_;
BooleanPrefMember* force_google_safe_search_;
BooleanPrefMember* force_youtube_safety_mode_;
- BooleanPrefMember* data_reduction_proxy_enabled_;
// Weak, owned by our owner.
#if defined(ENABLE_CONFIGURATION_POLICY)
@@ -320,33 +229,12 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
// static anyway since it is based on a command-line flag.
static bool g_never_throttle_requests_;
- // Total size of all content (excluding headers) that has been received
- // over the network.
- int64 received_content_length_;
-
- // Total original size of all content before it was transferred.
- int64 original_content_length_;
-
scoped_ptr<ClientHints> client_hints_;
bool first_request_;
prerender::PrerenderTracker* prerender_tracker_;
- // |data_reduction_proxy_params_| must outlive this ChromeNetworkDelegate.
- data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params_;
- // |data_reduction_proxy_usage_stats_| must outlive this
- // ChromeNetworkDelegate.
- data_reduction_proxy::DataReductionProxyUsageStats*
- data_reduction_proxy_usage_stats_;
- data_reduction_proxy::DataReductionProxyAuthRequestHandler*
- data_reduction_proxy_auth_request_handler_;
- data_reduction_proxy::DataReductionProxyStatisticsPrefs*
- data_reduction_proxy_statistics_prefs_;
-
- OnResolveProxyHandler on_resolve_proxy_handler_;
- ProxyConfigGetter proxy_config_getter_;
-
DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
};
« no previous file with comments | « chrome/browser/net/chrome_extensions_network_delegate.h ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698