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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc

Issue 2517383004: [scheduler] Bunch of improvements for blink scheduler tracing (Closed)
Patch Set: Some more Created 4 years, 1 month 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
Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
index fc38e84e800cc32390ae70df9d9df20e0e99cd38..ca5ac685b7db8bc37fdc744ff47e9443fbf822e4 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
@@ -48,6 +48,23 @@ const char* TaskQueue::NameForQueueType(TaskQueue::QueueType queue_type) {
return nullptr;
}
+// static
+const char* TaskQueue::PriorityToString(QueuePriority priority) {
+ switch (priority) {
+ case CONTROL_PRIORITY:
+ return "control";
+ case HIGH_PRIORITY:
+ return "high";
+ case NORMAL_PRIORITY:
+ return "normal";
+ case BEST_EFFORT_PRIORITY:
+ return "best_effort";
+ default:
+ NOTREACHED();
+ return nullptr;
+ }
+}
+
namespace internal {
TaskQueueImpl::TaskQueueImpl(
@@ -481,31 +498,14 @@ TaskQueueImpl::QueuePriority TaskQueueImpl::GetQueuePriority() const {
return static_cast<TaskQueue::QueuePriority>(set_index);
}
-// static
-const char* TaskQueueImpl::PriorityToString(QueuePriority priority) {
- switch (priority) {
- case CONTROL_PRIORITY:
- return "control";
- case HIGH_PRIORITY:
- return "high";
- case NORMAL_PRIORITY:
- return "normal";
- case BEST_EFFORT_PRIORITY:
- return "best_effort";
- default:
- NOTREACHED();
- return nullptr;
- }
-}
-
void TaskQueueImpl::AsValueInto(base::trace_event::TracedValue* state) const {
base::AutoLock lock(any_thread_lock_);
state->BeginDictionary();
state->SetString("name", GetName());
state->SetString(
- "id", base::StringPrintf(
- "%" PRIx64,
- static_cast<uint64_t>(reinterpret_cast<uintptr_t>(this))));
+ "task_queue_id",
+ base::StringPrintf("%" PRIx64, static_cast<uint64_t>(
+ reinterpret_cast<uintptr_t>(this))));
state->SetBoolean("enabled", main_thread_only().is_enabled);
state->SetString("time_domain_name",
main_thread_only().time_domain->GetName());

Powered by Google App Engine
This is Rietveld 408576698