Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
index c336696ce2d7655e141d41d1d2131656b9e264fe..aca7d15536b0813a0a61e7db4e762d76e0ff3cdb 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
@@ -391,6 +391,25 @@ void DataReductionProxyNetworkDelegate::OnCompletedInternal( |
RecordContentLength(*request, request_type, original_content_length); |
} |
+void DataReductionProxyNetworkDelegate::OnHeadersReceivedInternal( |
+ net::URLRequest* request, |
+ const net::CompletionCallback& callback, |
+ const net::HttpResponseHeaders* original_response_headers, |
bengr
2017/04/20 01:02:33
Is this guaranteed to be non-null?
RyanSturm
2017/04/20 20:25:45
I can't find any guarantees. The fact that it is a
|
+ scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
+ GURL* allowed_unsafe_redirect_url) { |
+ if (original_response_headers && |
+ IsEmptyImagePreview(*original_response_headers)) { |
+ DataReductionProxyData* data = |
+ DataReductionProxyData::GetDataAndCreateIfNecessary(request); |
+ data->set_lofi_received(true); |
+ } else if (original_response_headers && |
+ IsLitePagePreview(*original_response_headers)) { |
+ DataReductionProxyData* data = |
+ DataReductionProxyData::GetDataAndCreateIfNecessary(request); |
+ data->set_lite_page_received(true); |
+ } |
+} |
+ |
void DataReductionProxyNetworkDelegate::CalculateAndRecordDataUsage( |
const net::URLRequest& request, |
DataReductionProxyRequestType request_type) { |