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

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

Issue 2334623003: Store net::ProxyServer in HttpResponseInfo object (Closed)
Patch Set: Rebased, fix compile error Created 4 years, 2 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_bypass_protocol.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc
index 87bd4782b7b146d7d1e1a702d2a1eadd160d602c..9119d7c22a1470453c51396ee37e6a18bcd28748 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc
@@ -93,7 +93,9 @@ bool DataReductionProxyBypassProtocol::MaybeBypassProxyAndPrepareToRetry(
// Empty implies either that the request was served from cache or that
// request was served directly from the origin.
- if (request->proxy_server().IsEmpty()) {
+ if (!request->proxy_server().is_valid() ||
+ request->proxy_server().is_direct() ||
+ request->proxy_server().host_port_pair().IsEmpty()) {
ReportResponseProxyServerStatusHistogram(
RESPONSE_PROXY_SERVER_STATUS_EMPTY);
return false;
@@ -115,10 +117,15 @@ bool DataReductionProxyBypassProtocol::MaybeBypassProxyAndPrepareToRetry(
// then apply the bypass logic regardless.
// TODO(sclittle): Remove this workaround once http://crbug.com/476610 is
// fixed.
- data_reduction_proxy_type_info.proxy_servers.push_back(net::ProxyServer(
- net::ProxyServer::SCHEME_HTTPS, request->proxy_server()));
- data_reduction_proxy_type_info.proxy_servers.push_back(net::ProxyServer(
- net::ProxyServer::SCHEME_HTTP, request->proxy_server()));
+ const net::HostPortPair host_port_pair =
+ !request->proxy_server().is_valid() ||
+ request->proxy_server().is_direct()
+ ? net::HostPortPair()
+ : request->proxy_server().host_port_pair();
+ data_reduction_proxy_type_info.proxy_servers.push_back(
+ net::ProxyServer(net::ProxyServer::SCHEME_HTTPS, host_port_pair));
+ data_reduction_proxy_type_info.proxy_servers.push_back(
+ net::ProxyServer(net::ProxyServer::SCHEME_HTTP, host_port_pair));
data_reduction_proxy_type_info.proxy_index = 0;
} else {
ReportResponseProxyServerStatusHistogram(RESPONSE_PROXY_SERVER_STATUS_DRP);

Powered by Google App Engine
This is Rietveld 408576698