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

Unified Diff: cc/resources/managed_tile_state.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/resources/managed_tile_state.h ('k') | cc/resources/picture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/managed_tile_state.cc
diff --git a/cc/resources/managed_tile_state.cc b/cc/resources/managed_tile_state.cc
index 7109237b6127b5b2b1f1c3c193f5c0dbe63acad5..c760eb7797457985c00838aa466b5a99ac200e60 100644
--- a/cc/resources/managed_tile_state.cc
+++ b/cc/resources/managed_tile_state.cc
@@ -5,36 +5,43 @@
#include "cc/resources/managed_tile_state.h"
#include <limits>
-#include <string>
-#include "base/debug/trace_event_argument.h"
#include "cc/base/math_util.h"
namespace cc {
-std::string ManagedTileBinToString(ManagedTileBin bin) {
+scoped_ptr<base::Value> ManagedTileBinAsValue(ManagedTileBin bin) {
switch (bin) {
case NOW_AND_READY_TO_DRAW_BIN:
- return "NOW_AND_READY_TO_DRAW_BIN";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("NOW_AND_READY_TO_DRAW_BIN"));
case NOW_BIN:
- return "NOW_BIN";
+ return scoped_ptr<base::Value>(new base::StringValue("NOW_BIN"));
case SOON_BIN:
- return "SOON_BIN";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("SOON_BIN"));
case EVENTUALLY_AND_ACTIVE_BIN:
- return "EVENTUALLY_AND_ACTIVE_BIN";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("EVENTUALLY_AND_ACTIVE_BIN"));
case EVENTUALLY_BIN:
- return "EVENTUALLY_BIN";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("EVENTUALLY_BIN"));
case AT_LAST_AND_ACTIVE_BIN:
- return "AT_LAST_AND_ACTIVE_BIN";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("AT_LAST_AND_ACTIVE_BIN"));
case AT_LAST_BIN:
- return "AT_LAST_BIN";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("AT_LAST_BIN"));
case NEVER_BIN:
- return "NEVER_BIN";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("NEVER_BIN"));
case NUM_BINS:
NOTREACHED();
- return "Invalid Bin (NUM_BINS)";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("Invalid Bin (NUM_BINS)"));
}
- return "Invalid Bin (UNKNOWN)";
+ return scoped_ptr<base::Value>(
+ new base::StringValue("Invalid Bin (UNKNOWN)"));
}
ManagedTileState::ManagedTileState()
@@ -73,7 +80,7 @@
ManagedTileState::~ManagedTileState() {}
-void ManagedTileState::AsValueInto(base::debug::TracedValue* state) const {
+scoped_ptr<base::Value> ManagedTileState::AsValue() const {
bool has_resource = false;
bool has_active_task = false;
for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
@@ -83,13 +90,14 @@
bool is_using_gpu_memory = has_resource || has_active_task;
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
state->SetBoolean("has_resource", has_resource);
state->SetBoolean("is_using_gpu_memory", is_using_gpu_memory);
- state->SetString("bin", ManagedTileBinToString(bin));
- state->SetString("resolution", TileResolutionToString(resolution));
- state->SetString("priority_bin", TilePriorityBinToString(priority_bin));
- state->SetDouble("distance_to_visible",
- MathUtil::AsFloatSafely(distance_to_visible));
+ state->Set("bin", ManagedTileBinAsValue(bin).release());
+ state->Set("resolution", TileResolutionAsValue(resolution).release());
+ state->Set("priority_bin", TilePriorityBinAsValue(priority_bin).release());
+ state->Set("distance_to_visible",
+ MathUtil::AsValueSafely(distance_to_visible).release());
state->SetBoolean("required_for_activation", required_for_activation);
state->SetBoolean(
"is_solid_color",
@@ -99,6 +107,7 @@
tile_versions[raster_mode].mode_ == TileVersion::SOLID_COLOR_MODE &&
!SkColorGetA(tile_versions[raster_mode].solid_color_));
state->SetInteger("scheduled_priority", scheduled_priority);
+ return state.PassAs<base::Value>();
}
} // namespace cc
« no previous file with comments | « cc/resources/managed_tile_state.h ('k') | cc/resources/picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698