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

Unified Diff: third_party/WebKit/public/platform/scheduler/base/task_queue.h

Issue 2437003002: [scheduler] Add type to scheduler::TaskQueue (Closed)
Patch Set: fix windows compilation Created 4 years, 2 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
Index: third_party/WebKit/public/platform/scheduler/base/task_queue.h
diff --git a/third_party/WebKit/public/platform/scheduler/base/task_queue.h b/third_party/WebKit/public/platform/scheduler/base/task_queue.h
index e34730847fd71557418b342ef8dc37a3250de930..7450d87f9277924f7edf069bf74196e458bf129f 100644
--- a/third_party/WebKit/public/platform/scheduler/base/task_queue.h
+++ b/third_party/WebKit/public/platform/scheduler/base/task_queue.h
@@ -54,12 +54,33 @@ class BLINK_PLATFORM_EXPORT TaskQueue : public base::SingleThreadTaskRunner {
FIRST_QUEUE_PRIORITY = CONTROL_PRIORITY,
};
+ enum class QueueType {
+ // Keep TaskQueue::NameForQueueType in sync.
+ // This enum is used for a histogram and it should not be re-numbered.
+ CONTROL = 0,
+ DEFAULT = 1,
+ DEFAULT_LOADING = 2,
+ DEFAULT_TIMER = 3,
+ UNTHROTTLED = 4,
+ FRAME_LOADING = 5,
+ FRAME_TIMER = 6,
+ FRAME_UNTHROTTLED = 7,
+ COMPOSITOR = 8,
+ IDLE = 9,
+ TEST = 10,
+
+ COUNT = 11
+ };
+
+ // Returns name of the given queue type. Returned string has application
+ // lifetime.
+ static const char* NameForQueueType(QueueType queue_type);
+
// Options for constructing a TaskQueue. Once set the |name| and
// |should_monitor_quiescence| are immutable.
struct Spec {
- // Note |name| must have application lifetime.
- explicit Spec(const char* name)
- : name(name),
+ explicit Spec(QueueType type)
+ : type(type),
should_monitor_quiescence(false),
time_domain(nullptr),
should_notify_observers(true),
@@ -86,7 +107,7 @@ class BLINK_PLATFORM_EXPORT TaskQueue : public base::SingleThreadTaskRunner {
return *this;
}
- const char* name;
+ QueueType type;
bool should_monitor_quiescence;
TimeDomain* time_domain;
bool should_notify_observers;
@@ -116,6 +137,9 @@ class BLINK_PLATFORM_EXPORT TaskQueue : public base::SingleThreadTaskRunner {
virtual base::Optional<base::TimeTicks> GetNextScheduledWakeUp() = 0;
// Can be called on any thread.
+ virtual QueueType GetQueueType() const = 0;
+
+ // Can be called on any thread.
virtual const char* GetName() const = 0;
// Set the priority of the queue to |priority|. NOTE this must be called on

Powered by Google App Engine
This is Rietveld 408576698