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

Unified Diff: components/subresource_filter/content/renderer/subresource_filter_agent.cc

Issue 2581043003: Add page-level aggregation of SubresourceFilter time metrics. (Closed)
Patch Set: Address comments of engedy@ and add tests. Created 4 years 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: components/subresource_filter/content/renderer/subresource_filter_agent.cc
diff --git a/components/subresource_filter/content/renderer/subresource_filter_agent.cc b/components/subresource_filter/content/renderer/subresource_filter_agent.cc
index 05405c00b9a3b88998bed812659f29d7dc615c96..196acc34f7fe6e8cbee15a3cfdf7f2efd6df6246 100644
--- a/components/subresource_filter/content/renderer/subresource_filter_agent.cc
+++ b/components/subresource_filter/content/renderer/subresource_filter_agent.cc
@@ -60,6 +60,14 @@ void SubresourceFilterAgent::
render_frame()->GetRoutingID()));
}
+void SubresourceFilterAgent::SendDocumentLoadStatistics(
+ base::TimeDelta evaluation_total_wall_duration,
+ base::TimeDelta evaluation_total_cpu_duration) {
+ render_frame()->Send(new SubresourceFilterHostMsg_DocumentLoadStatistics(
+ render_frame()->GetRoutingID(), evaluation_total_wall_duration,
+ evaluation_total_cpu_duration));
+}
+
void SubresourceFilterAgent::OnActivateForProvisionalLoad(
ActivationState activation_state,
const GURL& url,
@@ -113,6 +121,9 @@ void SubresourceFilterAgent::RecordHistogramsOnLoadFinished() {
statistics.evaluation_total_cpu_duration,
base::TimeDelta::FromMicroseconds(1), base::TimeDelta::FromSeconds(10),
50);
+
+ SendDocumentLoadStatistics(statistics.evaluation_total_wall_duration,
+ statistics.evaluation_total_cpu_duration);
}
}

Powered by Google App Engine
This is Rietveld 408576698