OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw
ork_delegate.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw
ork_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 base::Optional<uint64_t> page_id; | 279 base::Optional<uint64_t> page_id; |
280 if (data && data->session_key() == | 280 if (data && data->session_key() == |
281 data_reduction_proxy_request_options_->GetSecureSession()) { | 281 data_reduction_proxy_request_options_->GetSecureSession()) { |
282 page_id = data->page_id(); | 282 page_id = data->page_id(); |
283 } | 283 } |
284 | 284 |
285 // Reset |request|'s DataReductionProxyData. | 285 // Reset |request|'s DataReductionProxyData. |
286 DataReductionProxyData::ClearData(request); | 286 DataReductionProxyData::ClearData(request); |
287 | 287 |
288 if (params::IsIncludedInHoldbackFieldTrial()) { | 288 if (params::IsIncludedInHoldbackFieldTrial()) { |
289 if (!WasEligibleWithoutHoldback(*request, proxy_info, proxy_retry_info)) | 289 if (WasEligibleWithoutHoldback(*request, proxy_info, proxy_retry_info)) { |
290 return; | 290 // For the holdback field trial, still log UMA as if the proxy was used. |
291 // For the holdback field trial, still log UMA as if the proxy was used. | 291 data = DataReductionProxyData::GetDataAndCreateIfNecessary(request); |
292 data = DataReductionProxyData::GetDataAndCreateIfNecessary(request); | 292 if (data) |
293 if (data) | 293 data->set_used_data_reduction_proxy(true); |
294 data->set_used_data_reduction_proxy(true); | 294 } |
295 | |
296 headers->RemoveHeader(chrome_proxy_header()); | |
297 VerifyHttpRequestHeaders(false, *headers); | |
298 return; | |
299 } | 295 } |
300 | 296 |
301 bool using_data_reduction_proxy = true; | 297 bool using_data_reduction_proxy = true; |
302 // The following checks rule out direct, invalid, and other connection types. | 298 // The following checks rule out direct, invalid, and other connection types. |
303 if (!proxy_info.is_http() && !proxy_info.is_https() && | 299 if (!proxy_info.is_http() && !proxy_info.is_https() && |
304 !proxy_info.is_quic()) { | 300 !proxy_info.is_quic()) { |
305 using_data_reduction_proxy = false; | 301 using_data_reduction_proxy = false; |
306 } else if (proxy_info.proxy_server().host_port_pair().IsEmpty()) { | 302 } else if (proxy_info.proxy_server().host_port_pair().IsEmpty()) { |
307 using_data_reduction_proxy = false; | 303 using_data_reduction_proxy = false; |
308 } else if (!data_reduction_proxy_config_->IsDataReductionProxy( | 304 } else if (!data_reduction_proxy_config_->IsDataReductionProxy( |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 } | 688 } |
693 | 689 |
694 void DataReductionProxyNetworkDelegate::RemoveChromeProxyECTHeader( | 690 void DataReductionProxyNetworkDelegate::RemoveChromeProxyECTHeader( |
695 net::HttpRequestHeaders* request_headers) const { | 691 net::HttpRequestHeaders* request_headers) const { |
696 DCHECK(thread_checker_.CalledOnValidThread()); | 692 DCHECK(thread_checker_.CalledOnValidThread()); |
697 | 693 |
698 request_headers->RemoveHeader(chrome_proxy_ect_header()); | 694 request_headers->RemoveHeader(chrome_proxy_ect_header()); |
699 } | 695 } |
700 | 696 |
701 } // namespace data_reduction_proxy | 697 } // namespace data_reduction_proxy |
OLD | NEW |