Chromium Code Reviews| 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()) { |
|
Not at Google. Contact bengr
2016/09/14 21:54:09
Why does this test need to change? Shouldn't the l
tbansal1
2016/09/14 22:04:16
I did not want to make an assumption that request-
|
| 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); |