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

Unified Diff: cc/resources/picture.cc

Issue 380763002: 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
Index: cc/resources/picture.cc
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index 959e64cd1445f67596f0ae2afa492df5748e77f5..7c60ee3dfacb0fef4b8e91ea2cad4d2abfca50e4 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -10,6 +10,7 @@
#include "base/base64.h"
#include "base/debug/trace_event.h"
+#include "base/debug/trace_event_argument.h"
#include "base/values.h"
#include "cc/base/math_util.h"
#include "cc/base/util.h"
@@ -586,18 +587,21 @@ Picture::PixelRefIterator& Picture::PixelRefIterator::operator++() {
scoped_refptr<base::debug::ConvertableToTraceFormat>
Picture::AsTraceableRasterData(float scale) const {
- scoped_ptr<base::DictionaryValue> raster_data(new base::DictionaryValue());
- raster_data->Set("picture_id", TracedValue::CreateIDRef(this).release());
+ scoped_refptr<base::debug::TracedValue> raster_data =
+ new base::debug::TracedValue();
+ TracedValue::SetIDRef(this, raster_data.get(), "picture_id");
raster_data->SetDouble("scale", scale);
- return TracedValue::FromValue(raster_data.release());
+ return raster_data;
}
scoped_refptr<base::debug::ConvertableToTraceFormat>
Picture::AsTraceableRecordData() const {
- scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue());
- record_data->Set("picture_id", TracedValue::CreateIDRef(this).release());
- record_data->Set("layer_rect", MathUtil::AsValue(layer_rect_).release());
- return TracedValue::FromValue(record_data.release());
+ scoped_refptr<base::debug::TracedValue> record_data =
+ new base::debug::TracedValue();
+ TracedValue::SetIDRef(this, record_data.get(), "picture_id");
+ record_data->BeginArray("layer_rect");
+ MathUtil::AddToTracedValue(layer_rect_, record_data.get());
+ return record_data;
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698