Index: cc/resources/tile_manager.cc |
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc |
index f6405bfde1b120e290b34bf7afe7cb40ebf479d3..bf10d9504150aab4e26657a70055f52fad30f463 100644 |
--- a/cc/resources/tile_manager.cc |
+++ b/cc/resources/tile_manager.cc |
@@ -9,7 +9,6 @@ |
#include <string> |
#include "base/bind.h" |
-#include "base/debug/trace_event_argument.h" |
#include "base/json/json_writer.h" |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
@@ -337,13 +336,12 @@ |
RasterTaskCompletionStats::RasterTaskCompletionStats() |
: completed_count(0u), canceled_count(0u) {} |
-scoped_refptr<base::debug::ConvertableToTraceFormat> |
-RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats) { |
- scoped_refptr<base::debug::TracedValue> state = |
- new base::debug::TracedValue(); |
+scoped_ptr<base::Value> RasterTaskCompletionStatsAsValue( |
+ const RasterTaskCompletionStats& stats) { |
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
state->SetInteger("completed_count", stats.completed_count); |
state->SetInteger("canceled_count", stats.canceled_count); |
- return state; |
+ return state.PassAs<base::Value>(); |
} |
// static |
@@ -669,7 +667,7 @@ |
"DidManage", |
TRACE_EVENT_SCOPE_THREAD, |
"state", |
- BasicStateAsValue()); |
+ TracedValue::FromValue(BasicStateAsValue().release())); |
TRACE_COUNTER_ID1("cc", |
"unused_memory_bytes", |
@@ -689,7 +687,8 @@ |
"DidUpdateVisibleTiles", |
TRACE_EVENT_SCOPE_THREAD, |
"stats", |
- RasterTaskCompletionStatsAsValue(update_visible_tiles_stats_)); |
+ TracedValue::FromValue(RasterTaskCompletionStatsAsValue( |
+ update_visible_tiles_stats_).release())); |
update_visible_tiles_stats_ = RasterTaskCompletionStats(); |
bool did_initialize_visible_tile = did_initialize_visible_tile_; |
@@ -697,27 +696,19 @@ |
return did_initialize_visible_tile; |
} |
-scoped_refptr<base::debug::ConvertableToTraceFormat> |
-TileManager::BasicStateAsValue() const { |
- scoped_refptr<base::debug::TracedValue> value = |
- new base::debug::TracedValue(); |
- BasicStateAsValueInto(value.get()); |
- return value; |
-} |
- |
-void TileManager::BasicStateAsValueInto(base::debug::TracedValue* state) const { |
+scoped_ptr<base::Value> TileManager::BasicStateAsValue() const { |
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
state->SetInteger("tile_count", tiles_.size()); |
- state->BeginDictionary("global_state"); |
- global_state_.AsValueInto(state); |
- state->EndDictionary(); |
-} |
- |
-void TileManager::AllTilesAsValueInto(base::debug::TracedValue* state) const { |
- for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
- state->BeginDictionary(); |
- it->second->AsValueInto(state); |
- state->EndDictionary(); |
- } |
+ state->Set("global_state", global_state_.AsValue().release()); |
+ return state.PassAs<base::Value>(); |
+} |
+ |
+scoped_ptr<base::Value> TileManager::AllTilesAsValue() const { |
+ scoped_ptr<base::ListValue> state(new base::ListValue()); |
+ for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) |
+ state->Append(it->second->AsValue().release()); |
+ |
+ return state.PassAs<base::Value>(); |
} |
void TileManager::AssignGpuMemoryToTiles( |