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

Unified Diff: cc/debug/rendering_stats.cc

Issue 898663003: cc: refactor of RenderingStats::TimeDeltaList::AddToTracedValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « cc/debug/rendering_stats.h ('k') | cc/debug/rendering_stats_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « cc/debug/rendering_stats.h ('k') | cc/debug/rendering_stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698