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

Unified Diff: cc/quads/render_pass.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/quads/render_pass.h ('k') | cc/quads/render_pass_draw_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/render_pass.cc
diff --git a/cc/quads/render_pass.cc b/cc/quads/render_pass.cc
index c7f83a36db0e467773ea1c10bacace09d3d163c2..43bb7cd1aedd6ec0daf2ccce5454c328f95b416d 100644
--- a/cc/quads/render_pass.cc
+++ b/cc/quads/render_pass.cc
@@ -4,6 +4,7 @@
#include "cc/quads/render_pass.h"
+#include "base/debug/trace_event_argument.h"
#include "base/values.h"
#include "cc/base/math_util.h"
#include "cc/debug/traced_value.h"
@@ -157,27 +158,39 @@ void RenderPass::SetAll(Id id,
DCHECK(shared_quad_state_list.empty());
}
-scoped_ptr<base::Value> RenderPass::AsValue() const {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
- value->Set("output_rect", MathUtil::AsValue(output_rect).release());
- value->Set("damage_rect", MathUtil::AsValue(damage_rect).release());
+void RenderPass::AsValueInto(base::debug::TracedValue* value) const {
+ value->BeginArray("output_rect");
+ MathUtil::AddToTracedValue(output_rect, value);
+ value->EndArray();
+
+ value->BeginArray("damage_rect");
+ MathUtil::AddToTracedValue(damage_rect, value);
+ value->EndArray();
+
value->SetBoolean("has_transparent_background", has_transparent_background);
value->SetInteger("copy_requests", copy_requests.size());
- scoped_ptr<base::ListValue> shared_states_value(new base::ListValue());
+
+ value->BeginArray("shared_quad_state_list");
for (size_t i = 0; i < shared_quad_state_list.size(); ++i) {
- shared_states_value->Append(shared_quad_state_list[i]->AsValue().release());
+ value->BeginDictionary();
+ shared_quad_state_list[i]->AsValueInto(value);
+ value->EndDictionary();
}
- value->Set("shared_quad_state_list", shared_states_value.release());
- scoped_ptr<base::ListValue> quad_list_value(new base::ListValue());
+ value->EndArray();
+
+ value->BeginArray("quad_list");
for (size_t i = 0; i < quad_list.size(); ++i) {
- quad_list_value->Append(quad_list[i]->AsValue().release());
+ value->BeginDictionary();
+ quad_list[i]->AsValueInto(value);
+ value->EndDictionary();
}
- value->Set("quad_list", quad_list_value.release());
+ value->EndArray();
TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"),
- value.get(), "cc::RenderPass", id.AsTracingId());
- return value.PassAs<base::Value>();
+ value,
+ "cc::RenderPass",
+ id.AsTracingId());
}
SharedQuadState* RenderPass::CreateAndAppendSharedQuadState() {
« no previous file with comments | « cc/quads/render_pass.h ('k') | cc/quads/render_pass_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698