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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc

Issue 1735203002: Revert of Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate (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_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
index 4ab77a83bdc6132319541a1c3e9cc81e856025d9..462571bb41c905a94683626f9ba8f5b686b90238 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
@@ -6,42 +6,24 @@
#include <cmath>
-#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
-#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
-#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
-#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "net/base/host_port_pair.h"
-#include "net/base/net_util.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_server.h"
-#include "net/proxy/proxy_service.h"
namespace data_reduction_proxy {
DataReductionProxyDelegate::DataReductionProxyDelegate(
DataReductionProxyRequestOptions* request_options,
- DataReductionProxyConfig* config,
- const DataReductionProxyConfigurator* configurator,
- DataReductionProxyEventCreator* event_creator,
- DataReductionProxyBypassStats* bypass_stats,
- net::NetLog* net_log)
+ DataReductionProxyConfig* config)
: request_options_(request_options),
- config_(config),
- configurator_(configurator),
- event_creator_(event_creator),
- bypass_stats_(bypass_stats),
- net_log_(net_log) {
+ config_(config) {
DCHECK(request_options);
DCHECK(config);
- DCHECK(configurator);
- DCHECK(event_creator);
- DCHECK(bypass_stats);
- DCHECK(net_log);
}
DataReductionProxyDelegate::~DataReductionProxyDelegate() {
@@ -52,9 +34,6 @@
int load_flags,
const net::ProxyService& proxy_service,
net::ProxyInfo* result) {
- DCHECK(result);
- OnResolveProxyHandler(url, load_flags, configurator_->GetProxyConfig(),
- proxy_service.proxy_retry_info(), config_, result);
}
void DataReductionProxyDelegate::OnTunnelConnectCompleted(
@@ -69,14 +48,6 @@
void DataReductionProxyDelegate::OnFallback(const net::ProxyServer& bad_proxy,
int net_error) {
- if (bad_proxy.is_valid() &&
- config_->IsDataReductionProxy(bad_proxy.host_port_pair(), nullptr)) {
- event_creator_->AddProxyFallbackEvent(net_log_, bad_proxy.ToURI(),
- net_error);
- }
-
- if (bypass_stats_)
- bypass_stats_->OnProxyFallback(bad_proxy, net_error);
}
void DataReductionProxyDelegate::OnBeforeSendHeaders(
@@ -109,36 +80,4 @@
const net::HttpResponseHeaders& response_headers) {
}
-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) {
- DCHECK(config);
- DCHECK(result->is_empty() || result->is_direct() ||
- !config->IsDataReductionProxy(result->proxy_server().host_port_pair(),
- NULL));
- bool data_saver_proxy_used = true;
- if (!result->proxy_server().is_direct() || result->proxy_list().size() != 1 ||
- url.SchemeIsWSOrWSS())
- return;
-
- if (data_reduction_proxy_config.is_valid()) {
- net::ProxyInfo data_reduction_proxy_info;
- data_reduction_proxy_config.proxy_rules().Apply(url,
- &data_reduction_proxy_info);
- data_reduction_proxy_info.DeprioritizeBadProxies(proxy_retry_info);
- if (!data_reduction_proxy_info.proxy_server().is_direct())
- result->OverrideProxyList(data_reduction_proxy_info.proxy_list());
- } else {
- data_saver_proxy_used = false;
- }
- if (config->enabled_by_user_and_reachable() && url.SchemeIsHTTPOrHTTPS() &&
- !url.SchemeIsCryptographic() && !net::IsLocalhost(url.host())) {
- UMA_HISTOGRAM_BOOLEAN("DataReductionProxy.ConfigService.HTTPRequests",
- data_saver_proxy_used);
- }
-}
-
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698