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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 421183003: Revert of 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index e155be69517bd86761125deddecbded319767b07..fdf8e5cfb37dd2adf27f1381ac141c953138853d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -9,7 +9,6 @@
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
-#include "base/debug/trace_event_argument.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram.h"
#include "base/stl_util.h"
@@ -529,8 +528,8 @@
}
}
-void LayerTreeHostImpl::FrameData::AsValueInto(
- base::debug::TracedValue* value) const {
+scoped_ptr<base::Value> LayerTreeHostImpl::FrameData::AsValue() const {
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->SetBoolean("contains_incomplete_tile", contains_incomplete_tile);
value->SetBoolean("has_no_damage", has_no_damage);
@@ -540,14 +539,12 @@
TRACE_EVENT_CATEGORY_GROUP_ENABLED(
TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), &quads_enabled);
if (quads_enabled) {
- value->BeginArray("render_passes");
- for (size_t i = 0; i < render_passes.size(); ++i) {
- value->BeginDictionary();
- render_passes[i]->AsValueInto(value);
- value->EndDictionary();
- }
- value->EndArray();
- }
+ scoped_ptr<base::ListValue> render_pass_list(new base::ListValue());
+ for (size_t i = 0; i < render_passes.size(); ++i)
+ render_pass_list->Append(render_passes[i]->AsValue().release());
+ value->Set("render_passes", render_pass_list.release());
+ }
+ return value.PassAs<base::Value>();
}
void LayerTreeHostImpl::FrameData::AppendRenderPass(
@@ -1546,7 +1543,7 @@
TRACE_DISABLED_BY_DEFAULT("devtools.timeline.layers"),
"cc::LayerTreeHostImpl",
id_,
- AsValueWithFrame(frame));
+ TracedValue::FromValue(AsValueWithFrame(frame).release()));
}
const DrawMode draw_mode = GetDrawMode();
@@ -3172,66 +3169,29 @@
return gfx::FrameTime::Now();
}
-scoped_refptr<base::debug::ConvertableToTraceFormat>
-LayerTreeHostImpl::AsValue() const {
- return AsValueWithFrame(NULL);
-}
-
-scoped_refptr<base::debug::ConvertableToTraceFormat>
-LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const {
- scoped_refptr<base::debug::TracedValue> state =
- new base::debug::TracedValue();
- AsValueWithFrameInto(frame, state.get());
- return state;
-}
-
-void LayerTreeHostImpl::AsValueWithFrameInto(
- FrameData* frame,
- base::debug::TracedValue* state) const {
- if (this->pending_tree_) {
- state->BeginDictionary("activation_state");
- ActivationStateAsValueInto(state);
- state->EndDictionary();
- }
- state->BeginDictionary("device_viewport_size");
- MathUtil::AddToTracedValue(device_viewport_size_, state);
- state->EndDictionary();
- if (tile_manager_) {
- state->BeginArray("tiles");
- tile_manager_->AllTilesAsValueInto(state);
- state->EndArray();
- }
- state->BeginDictionary("active_tree");
- active_tree_->AsValueInto(state);
- state->EndDictionary();
- if (pending_tree_) {
- state->BeginDictionary("pending_tree");
- pending_tree_->AsValueInto(state);
- state->EndDictionary();
- }
- if (frame) {
- state->BeginDictionary("frame");
- frame->AsValueInto(state);
- state->EndDictionary();
- }
-}
-
-scoped_refptr<base::debug::ConvertableToTraceFormat>
-LayerTreeHostImpl::ActivationStateAsValue() const {
- scoped_refptr<base::debug::TracedValue> state =
- new base::debug::TracedValue();
- ActivationStateAsValueInto(state.get());
- return state;
-}
-
-void LayerTreeHostImpl::ActivationStateAsValueInto(
- base::debug::TracedValue* state) const {
- TracedValue::SetIDRef(this, state, "lthi");
- if (tile_manager_) {
- state->BeginDictionary("tile_manager");
- tile_manager_->BasicStateAsValueInto(state);
- state->EndDictionary();
- }
+scoped_ptr<base::Value> LayerTreeHostImpl::AsValueWithFrame(
+ FrameData* frame) const {
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
+ if (this->pending_tree_)
+ state->Set("activation_state", ActivationStateAsValue().release());
+ state->Set("device_viewport_size",
+ MathUtil::AsValue(device_viewport_size_).release());
+ if (tile_manager_)
+ state->Set("tiles", tile_manager_->AllTilesAsValue().release());
+ state->Set("active_tree", active_tree_->AsValue().release());
+ if (pending_tree_)
+ state->Set("pending_tree", pending_tree_->AsValue().release());
+ if (frame)
+ state->Set("frame", frame->AsValue().release());
+ return state.PassAs<base::Value>();
+}
+
+scoped_ptr<base::Value> LayerTreeHostImpl::ActivationStateAsValue() const {
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
+ state->Set("lthi", TracedValue::CreateIDRef(this).release());
+ if (tile_manager_)
+ state->Set("tile_manager", tile_manager_->BasicStateAsValue().release());
+ return state.PassAs<base::Value>();
}
void LayerTreeHostImpl::SetDebugState(
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698