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

Unified Diff: cc/resources/pixel_buffer_raster_worker_pool.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/pixel_buffer_raster_worker_pool.h ('k') | cc/resources/raster_mode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/pixel_buffer_raster_worker_pool.cc
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index d7554736942a66ee541c065c99320385c42d0234..def15c411e5256e07fe8c84eced683c47590bee6 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -8,7 +8,6 @@
#include "base/containers/stack_container.h"
#include "base/debug/trace_event.h"
-#include "base/debug/trace_event_argument.h"
#include "cc/debug/traced_value.h"
#include "cc/resources/resource.h"
#include "gpu/command_buffer/client/gles2_interface.h"
@@ -223,7 +222,12 @@
check_for_completed_raster_task_notifier_.Schedule();
TRACE_EVENT_ASYNC_STEP_INTO1(
- "cc", "ScheduledTasks", this, StateName(), "state", StateAsValue());
+ "cc",
+ "ScheduledTasks",
+ this,
+ StateName(),
+ "state",
+ TracedValue::FromValue(StateAsValue().release()));
}
void PixelBufferRasterWorkerPool::CheckForCompletedTasks() {
@@ -456,7 +460,12 @@
ScheduleMoreTasks();
TRACE_EVENT_ASYNC_STEP_INTO1(
- "cc", "ScheduledTasks", this, StateName(), "state", StateAsValue());
+ "cc",
+ "ScheduledTasks",
+ this,
+ StateName(),
+ "state",
+ TracedValue::FromValue(StateAsValue().release()));
// Schedule another check for completed raster tasks while there are
// pending raster tasks or pending uploads.
@@ -733,29 +742,29 @@
completed_tasks_.clear();
}
-scoped_refptr<base::debug::ConvertableToTraceFormat>
-PixelBufferRasterWorkerPool::StateAsValue() const {
- scoped_refptr<base::debug::TracedValue> state =
- new base::debug::TracedValue();
+scoped_ptr<base::Value> PixelBufferRasterWorkerPool::StateAsValue() const {
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue);
+
state->SetInteger("completed_count", completed_raster_tasks_.size());
state->SetInteger("pending_count", raster_task_states_.size());
state->SetInteger("pending_upload_count",
raster_tasks_with_pending_upload_.size());
state->SetInteger("pending_required_for_activation_count",
raster_tasks_required_for_activation_count_);
- state->BeginDictionary("throttle_state");
- ThrottleStateAsValueInto(state.get());
- state->EndDictionary();
- return state;
-}
-
-void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto(
- base::debug::TracedValue* throttle_state) const {
+ state->Set("throttle_state", ThrottleStateAsValue().release());
+ return state.PassAs<base::Value>();
+}
+
+scoped_ptr<base::Value> PixelBufferRasterWorkerPool::ThrottleStateAsValue()
+ const {
+ scoped_ptr<base::DictionaryValue> throttle_state(new base::DictionaryValue);
+
throttle_state->SetInteger("bytes_available_for_upload",
max_bytes_pending_upload_ - bytes_pending_upload_);
throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_);
throttle_state->SetInteger("scheduled_raster_task_count",
scheduled_raster_task_count_);
+ return throttle_state.PassAs<base::Value>();
}
} // namespace cc
« no previous file with comments | « cc/resources/pixel_buffer_raster_worker_pool.h ('k') | cc/resources/raster_mode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698