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

Unified Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc

Issue 2780003003: Send an event to the page load metrics to track resource starting. (Closed)
Patch Set: Created 3 years, 9 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: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
index e3f51bf4946a1b2cc9437a0e973f4b77a78e5325..2fb5d27aebda73ace023bbe3dadb5e09145d4292 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
@@ -244,6 +244,20 @@ PageLoadTracker* MetricsWebContentsObserver::GetTrackerOrNullForRequest(
return nullptr;
}
+void MetricsWebContentsObserver::OnRequestStarted(
+ const content::GlobalRequestID& request_id,
+ content::ResourceType resource_type,
+ base::TimeTicks creation_time) {
+ PageLoadTracker* tracker =
+ GetTrackerOrNullForRequest(request_id, resource_type, creation_time);
+ if (tracker) {
+ ExtraRequestInfo extra_request_info(
RyanSturm 2017/03/29 19:03:47 Debatable whether the two request methods should s
Pete Williamson 2017/04/13 23:10:21 OK, I'll separate it into two types (and add the r
+ false /*was_cached*/, 0 /*raw_body_bytes*/,
+ false /*used_data_reduction_proxy*/, 0 /*original_content_length*/);
+ tracker->OnStartedResource(extra_request_info);
+ }
+}
+
void MetricsWebContentsObserver::OnRequestComplete(
const content::GlobalRequestID& request_id,
content::ResourceType resource_type,

Powered by Google App Engine
This is Rietveld 408576698