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

Unified Diff: cc/layers/picture_layer_impl.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/layers/picture_layer_impl.h ('k') | cc/layers/surface_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 2544c0d78c8212af790d6679a18b48e7eec8122d..dcbcc7474a0d1ed0a0fb9aac6a1377e24d6c49b2 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <limits>
+#include "base/debug/trace_event_argument.h"
#include "base/time/time.h"
#include "cc/base/math_util.h"
#include "cc/base/util.h"
@@ -1335,31 +1336,42 @@ void PictureLayerImpl::GetDebugBorderProperties(
*width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl());
}
-void PictureLayerImpl::AsValueInto(base::DictionaryValue* state) const {
+void PictureLayerImpl::AsValueInto(base::debug::TracedValue* state) const {
const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
LayerImpl::AsValueInto(state);
state->SetDouble("ideal_contents_scale", ideal_contents_scale_);
state->SetDouble("geometry_contents_scale", MaximumTilingContentsScale());
- state->Set("tilings", tilings_->AsValue().release());
- state->Set("pictures", pile_->AsValue().release());
- state->Set("invalidation", invalidation_.AsValue().release());
+ state->BeginArray("tilings");
+ tilings_->AsValueInto(state);
+ state->EndArray();
- scoped_ptr<base::ListValue> coverage_tiles(new base::ListValue);
+ state->BeginArray("pictures");
+ pile_->AsValueInto(state);
+ state->EndArray();
+
+ state->BeginArray("invalidation");
+ invalidation_.AsValueInto(state);
+ state->EndArray();
+
+ state->BeginArray("coverage_tiles");
for (PictureLayerTilingSet::CoverageIterator iter(tilings_.get(),
contents_scale_x(),
gfx::Rect(content_bounds()),
ideal_contents_scale_);
iter;
++iter) {
- scoped_ptr<base::DictionaryValue> tile_data(new base::DictionaryValue);
- tile_data->Set("geometry_rect",
- MathUtil::AsValue(iter.geometry_rect()).release());
+ state->BeginDictionary();
+
+ state->BeginArray("geometry_rect");
+ MathUtil::AddToTracedValue(iter.geometry_rect(), state);
+ state->EndArray();
+
if (*iter)
- tile_data->Set("tile", TracedValue::CreateIDRef(*iter).release());
+ TracedValue::SetIDRef(*iter, state, "tile");
- coverage_tiles->Append(tile_data.release());
+ state->EndDictionary();
}
- state->Set("coverage_tiles", coverage_tiles.release());
+ state->EndArray();
}
size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/surface_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698