Commit 2fe989c4 authored by heejin.r.chung's avatar heejin.r.chung Committed by Commit bot

cc: refactor of RenderingStats::TimeDeltaList::AddToTracedValue

To match the recent change in MathUtil::AddToTracedValue,
pass name as parameter and Begin/End internally.

R=danakj

Review URL: https://codereview.chromium.org/898663003

Cr-Commit-Position: refs/heads/master@{#314714}
parent 8da7297a
......@@ -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;
}
......
......@@ -24,7 +24,8 @@ struct CC_EXPORT RenderingStats {
~TimeDeltaList();
void Append(base::TimeDelta value);
void AddToTracedValue(base::debug::TracedValue* list_value) const;
void AddToTracedValue(const char* name,
base::debug::TracedValue* list_value) const;
void Add(const TimeDeltaList& other);
......
......@@ -15,9 +15,7 @@ namespace {
static std::string ToString(const RenderingStats::TimeDeltaList& list) {
scoped_refptr<base::debug::TracedValue> value =
new base::debug::TracedValue();
value->BeginArray("list_value");
list.AddToTracedValue(value.get());
value->EndArray();
list.AddToTracedValue("list_value", value.get());
return value->ToString();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment