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

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

Issue 2600253002: Aggregate DocumentSubresourceFilter counters on page level. (Closed)
Patch Set: rebase Created 3 years, 11 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: 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 bf6ac6f618ea407de03710b06a8cb6686867646f..48f19565897e7a03135feceaec3e899d9303bd99 100644
--- a/components/subresource_filter/content/renderer/subresource_filter_agent.cc
+++ b/components/subresource_filter/content/renderer/subresource_filter_agent.cc
@@ -62,11 +62,9 @@ void SubresourceFilterAgent::
}
void SubresourceFilterAgent::SendDocumentLoadStatistics(
- base::TimeDelta evaluation_total_wall_duration,
- base::TimeDelta evaluation_total_cpu_duration) {
+ const DocumentLoadStatistics& statistics) {
render_frame()->Send(new SubresourceFilterHostMsg_DocumentLoadStatistics(
- render_frame()->GetRoutingID(), evaluation_total_wall_duration,
- evaluation_total_cpu_duration));
+ render_frame()->GetRoutingID(), statistics));
}
void SubresourceFilterAgent::OnActivateForProvisionalLoad(
@@ -116,16 +114,17 @@ void SubresourceFilterAgent::RecordHistogramsOnLoadFinished() {
statistics.evaluation_total_wall_duration,
base::TimeDelta::FromMicroseconds(1), base::TimeDelta::FromSeconds(10),
50);
-
UMA_HISTOGRAM_CUSTOM_MICRO_TIMES(
"SubresourceFilter.DocumentLoad.SubresourceEvaluation.TotalCPUDuration",
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);
+ } else {
+ DCHECK(statistics.evaluation_total_wall_duration.is_zero());
+ DCHECK(statistics.evaluation_total_cpu_duration.is_zero());
}
+
+ SendDocumentLoadStatistics(statistics);
}
void SubresourceFilterAgent::OnDestruct() {

Powered by Google App Engine
This is Rietveld 408576698