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

Unified Diff: cc/debug/frame_viewer_instrumentation.h

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN 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/base/region.cc ('k') | cc/debug/rendering_stats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/frame_viewer_instrumentation.h
diff --git a/cc/debug/frame_viewer_instrumentation.h b/cc/debug/frame_viewer_instrumentation.h
index 16cf4335ac2bb20f6fcbbbd8183aa6b4fd29142a..7d97b52e0059216c26e0c9126c80886729ff479e 100644
--- a/cc/debug/frame_viewer_instrumentation.h
+++ b/cc/debug/frame_viewer_instrumentation.h
@@ -23,17 +23,18 @@ const char kRasterMode[] = "rasterMode";
const char kAnalyzeTask[] = "AnalyzeTask";
const char kRasterTask[] = "RasterTask";
-scoped_ptr<base::Value> TileDataAsValue(const void* tile_id,
- TileResolution tile_resolution,
- int source_frame_number,
- int layer_id) {
- scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue);
- res->Set(internal::kTileId, TracedValue::CreateIDRef(tile_id).release());
- res->Set(internal::kTileResolution,
- TileResolutionAsValue(tile_resolution).release());
+scoped_refptr<base::debug::ConvertableToTraceFormat> TileDataAsValue(
+ const void* tile_id,
+ TileResolution tile_resolution,
+ int source_frame_number,
+ int layer_id) {
+ scoped_refptr<base::debug::TracedValue> res(new base::debug::TracedValue());
+ TracedValue::SetIDRef(tile_id, res, internal::kTileId);
+ res->SetString(internal::kTileResolution,
+ TileResolutionToString(tile_resolution));
res->SetInteger(internal::kSourceFrameNumber, source_frame_number);
res->SetInteger(internal::kLayerId, layer_id);
- return res.PassAs<base::Value>();
+ return res;
}
} // namespace internal
@@ -48,10 +49,8 @@ class ScopedAnalyzeTask {
internal::kCategory,
internal::kAnalyzeTask,
internal::kTileData,
- TracedValue::FromValue(internal::TileDataAsValue(tile_id,
- tile_resolution,
- source_frame_number,
- layer_id).release()));
+ internal::TileDataAsValue(
+ tile_id, tile_resolution, source_frame_number, layer_id));
}
~ScopedAnalyzeTask() {
TRACE_EVENT_END0(internal::kCategory, internal::kAnalyzeTask);
@@ -72,12 +71,10 @@ class ScopedRasterTask {
internal::kCategory,
internal::kRasterTask,
internal::kTileData,
- TracedValue::FromValue(internal::TileDataAsValue(tile_id,
- tile_resolution,
- source_frame_number,
- layer_id).release()),
+ internal::TileDataAsValue(
+ tile_id, tile_resolution, source_frame_number, layer_id),
internal::kRasterMode,
- TracedValue::FromValue(RasterModeAsValue(raster_mode).release()));
+ RasterModeToString(raster_mode));
}
~ScopedRasterTask() {
TRACE_EVENT_END0(internal::kCategory, internal::kRasterTask);
« no previous file with comments | « cc/base/region.cc ('k') | cc/debug/rendering_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698