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

Unified Diff: cc/debug/rendering_stats.cc

Issue 421183003: Revert of Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 b5989fc121285dc49483498ab3060f84ae9cc3d9..47bc7c7d1556d3e47f352e99af3a896336472b76 100644
--- a/cc/debug/rendering_stats.cc
+++ b/cc/debug/rendering_stats.cc
@@ -16,12 +16,14 @@
values.push_back(value);
}
-void RenderingStats::TimeDeltaList::AddToTracedValue(
- base::debug::TracedValue* list_value) const {
+scoped_ptr<base::ListValue>
+RenderingStats::TimeDeltaList::AsListValueInMilliseconds() const {
+ scoped_ptr<base::ListValue> list_value(new base::ListValue);
std::list<base::TimeDelta>::const_iterator iter;
for (iter = values.begin(); iter != values.end(); ++iter) {
list_value->AppendDouble(iter->InMillisecondsF());
}
+ return list_value.Pass();
}
void RenderingStats::TimeDeltaList::Add(const TimeDeltaList& other) {
@@ -37,14 +39,13 @@
scoped_refptr<base::debug::ConvertableToTraceFormat>
RenderingStats::MainThreadRenderingStats::AsTraceableData() const {
- scoped_refptr<base::debug::TracedValue> record_data =
- new base::debug::TracedValue();
+ scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue());
record_data->SetInteger("frame_count", frame_count);
record_data->SetDouble("paint_time", paint_time.InSecondsF());
record_data->SetInteger("painted_pixel_count", painted_pixel_count);
record_data->SetDouble("record_time", record_time.InSecondsF());
record_data->SetInteger("recorded_pixel_count", recorded_pixel_count);
- return record_data;
+ return TracedValue::FromValue(record_data.release());
}
void RenderingStats::MainThreadRenderingStats::Add(
@@ -68,39 +69,34 @@
scoped_refptr<base::debug::ConvertableToTraceFormat>
RenderingStats::ImplThreadRenderingStats::AsTraceableData() const {
- scoped_refptr<base::debug::TracedValue> record_data =
- new base::debug::TracedValue();
+ scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue());
record_data->SetInteger("frame_count", frame_count);
record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF());
record_data->SetInteger("rasterized_pixel_count", rasterized_pixel_count);
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();
-
- record_data->BeginArray("draw_duration_estimate_ms");
- draw_duration_estimate.AddToTracedValue(record_data.get());
- record_data->EndArray();
-
- record_data->BeginArray("begin_main_frame_to_commit_duration_ms");
- begin_main_frame_to_commit_duration.AddToTracedValue(record_data.get());
- record_data->EndArray();
-
- 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();
-
- record_data->BeginArray("commit_to_activate_duration_ms");
- commit_to_activate_duration.AddToTracedValue(record_data.get());
- record_data->EndArray();
-
- record_data->BeginArray("commit_to_activate_duration_estimate_ms");
- commit_to_activate_duration_estimate.AddToTracedValue(record_data.get());
- record_data->EndArray();
- return record_data;
+ record_data->Set("draw_duration_ms",
+ draw_duration.AsListValueInMilliseconds().release());
+ record_data->Set(
+ "draw_duration_estimate_ms",
+ draw_duration_estimate.AsListValueInMilliseconds().release());
+ record_data->Set(
+ "begin_main_frame_to_commit_duration_ms",
+ begin_main_frame_to_commit_duration.AsListValueInMilliseconds()
+ .release());
+ record_data->Set(
+ "begin_main_frame_to_commit_duration_estimate_ms",
+ begin_main_frame_to_commit_duration_estimate.AsListValueInMilliseconds()
+ .release());
+ record_data->Set(
+ "commit_to_activate_duration_ms",
+ commit_to_activate_duration.AsListValueInMilliseconds().release());
+ record_data->Set(
+ "commit_to_activate_duration_estimate_ms",
+ commit_to_activate_duration_estimate.AsListValueInMilliseconds()
+ .release());
+ return TracedValue::FromValue(record_data.release());
}
void RenderingStats::ImplThreadRenderingStats::Add(
« 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