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

Unified Diff: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc

Issue 2833523002: Adding opt out and previews type information to DRP pingback (Closed)
Patch Set: bengr comments Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/metrics_web_contents_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
index 2b55079ba4bdbda4f6b3b35da47f4c26130c0b7d..55c772264ceabe16d12d41497c9f69aab16a0318 100644
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -351,7 +351,8 @@ void NotifyUIThreadOfRequestComplete(
const content::GlobalRequestID& request_id,
ResourceType resource_type,
bool was_cached,
- bool used_data_reduction_proxy,
+ std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
+ data_reduction_proxy_data,
int net_error,
int64_t total_received_bytes,
int64_t raw_body_bytes,
@@ -380,9 +381,10 @@ void NotifyUIThreadOfRequestComplete(
page_load_metrics::MetricsWebContentsObserver::FromWebContents(
web_contents);
if (metrics_observer) {
- metrics_observer->OnRequestComplete(
- request_id, resource_type, was_cached, used_data_reduction_proxy,
- raw_body_bytes, original_content_length, request_creation_time);
+ metrics_observer->OnRequestComplete(request_id, resource_type, was_cached,
+ std::move(data_reduction_proxy_data),
+ raw_body_bytes, original_content_length,
+ request_creation_time);
}
}
@@ -823,9 +825,12 @@ void ChromeResourceDispatcherHostDelegate::RequestComplete(
data_reduction_proxy::DataReductionProxyData* data =
data_reduction_proxy::DataReductionProxyData::GetData(*url_request);
- bool used_data_reduction_proxy = data && data->used_data_reduction_proxy();
+ std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
+ data_reduction_proxy_data;
+ if (data)
+ data_reduction_proxy_data = data->DeepCopy();
int64_t original_content_length =
- used_data_reduction_proxy
+ data && data->used_data_reduction_proxy()
? data_reduction_proxy::util::CalculateEffectiveOCL(*url_request)
: url_request->GetRawBodyBytes();
@@ -834,8 +839,9 @@ void ChromeResourceDispatcherHostDelegate::RequestComplete(
base::BindOnce(&NotifyUIThreadOfRequestComplete,
info->GetWebContentsGetterForRequest(), url_request->url(),
info->GetGlobalRequestID(), info->GetResourceType(),
- url_request->was_cached(), used_data_reduction_proxy,
- net_error, url_request->GetTotalReceivedBytes(),
+ url_request->was_cached(),
+ base::Passed(&data_reduction_proxy_data), net_error,
+ url_request->GetTotalReceivedBytes(),
url_request->GetRawBodyBytes(), original_content_length,
url_request->creation_time(),
base::TimeTicks::Now() - url_request->creation_time()));
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/metrics_web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698