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

Unified Diff: cc/resources/tile.cc

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/resources/tile.h ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile.cc
diff --git a/cc/resources/tile.cc b/cc/resources/tile.cc
index 48a10db70ffc205520fc8a26b41060420bab30b8..2725a93623b46c2d6a7d2881ed92d5aee1068a3f 100644
--- a/cc/resources/tile.cc
+++ b/cc/resources/tile.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/debug/trace_event_argument.h"
#include "cc/base/math_util.h"
#include "cc/debug/traced_value.h"
#include "cc/resources/tile_manager.h"
@@ -61,20 +62,31 @@ void Tile::MarkRequiredForActivation() {
tile_manager_->DidChangeTilePriority(this);
}
-scoped_ptr<base::Value> Tile::AsValue() const {
- scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
+void Tile::AsValueInto(base::debug::TracedValue* res) const {
TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
- TRACE_DISABLED_BY_DEFAULT("cc.debug"), res.get(), "cc::Tile", this);
- res->Set("picture_pile",
- TracedValue::CreateIDRef(picture_pile_.get()).release());
+ TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this);
+ TracedValue::SetIDRef(picture_pile_.get(), res, "picture_pile");
res->SetDouble("contents_scale", contents_scale_);
- res->Set("content_rect", MathUtil::AsValue(content_rect_).release());
+
+ res->BeginArray("content_rect");
+ MathUtil::AddToTracedValue(content_rect_, res);
+ res->EndArray();
+
res->SetInteger("layer_id", layer_id_);
- res->Set("active_priority", priority_[ACTIVE_TREE].AsValue().release());
- res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release());
- res->Set("managed_state", managed_state_.AsValue().release());
+
+ res->BeginDictionary("active_priority");
+ priority_[ACTIVE_TREE].AsValueInto(res);
+ res->EndDictionary();
+
+ res->BeginDictionary("pending_priority");
+ priority_[PENDING_TREE].AsValueInto(res);
+ res->EndDictionary();
+
+ res->BeginDictionary("managed_state");
+ managed_state_.AsValueInto(res);
+ res->EndDictionary();
+
res->SetBoolean("use_picture_analysis", use_picture_analysis());
- return res.PassAs<base::Value>();
}
size_t Tile::GPUMemoryUsageInBytes() const {
« no previous file with comments | « cc/resources/tile.h ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698