Index: cc/debug/rendering_stats.cc |
diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc |
index 9c62a3c5ea6600683b5e5fdde71bea7246f8eeef..2247b3aded56a4fa8c45e39f03a9a17e6249f48a 100644 |
--- a/cc/debug/rendering_stats.cc |
+++ b/cc/debug/rendering_stats.cc |
@@ -17,10 +17,13 @@ void RenderingStats::TimeDeltaList::Append(base::TimeDelta value) { |
} |
void RenderingStats::TimeDeltaList::AddToTracedValue( |
+ const char* name, |
base::debug::TracedValue* list_value) const { |
+ list_value->BeginArray(name); |
for (const auto& value : values) { |
list_value->AppendDouble(value.InMillisecondsF()); |
} |
+ list_value->EndArray(); |
} |
void RenderingStats::TimeDeltaList::Add(const TimeDeltaList& other) { |
@@ -48,30 +51,22 @@ RenderingStats::AsTraceableData() const { |
record_data->SetInteger("visible_content_area", visible_content_area); |
record_data->SetInteger("approximated_visible_content_area", |
approximated_visible_content_area); |
- record_data->BeginArray("draw_duration_ms"); |
- draw_duration.AddToTracedValue(record_data.get()); |
- record_data->EndArray(); |
+ draw_duration.AddToTracedValue("draw_duration_ms", record_data.get()); |
- record_data->BeginArray("draw_duration_estimate_ms"); |
- draw_duration_estimate.AddToTracedValue(record_data.get()); |
- record_data->EndArray(); |
+ draw_duration_estimate.AddToTracedValue("draw_duration_estimate_ms", |
+ record_data.get()); |
- record_data->BeginArray("begin_main_frame_to_commit_duration_ms"); |
- begin_main_frame_to_commit_duration.AddToTracedValue(record_data.get()); |
- record_data->EndArray(); |
+ begin_main_frame_to_commit_duration.AddToTracedValue( |
+ "begin_main_frame_to_commit_duration_ms", record_data.get()); |
- record_data->BeginArray("begin_main_frame_to_commit_duration_estimate_ms"); |
begin_main_frame_to_commit_duration_estimate.AddToTracedValue( |
- record_data.get()); |
- record_data->EndArray(); |
+ "begin_main_frame_to_commit_duration_estimate_ms", record_data.get()); |
- record_data->BeginArray("commit_to_activate_duration_ms"); |
- commit_to_activate_duration.AddToTracedValue(record_data.get()); |
- record_data->EndArray(); |
+ commit_to_activate_duration.AddToTracedValue("commit_to_activate_duration_ms", |
+ record_data.get()); |
- record_data->BeginArray("commit_to_activate_duration_estimate_ms"); |
- commit_to_activate_duration_estimate.AddToTracedValue(record_data.get()); |
- record_data->EndArray(); |
+ commit_to_activate_duration_estimate.AddToTracedValue( |
+ "commit_to_activate_duration_estimate_ms", record_data.get()); |
return record_data; |
} |