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

Unified Diff: Source/platform/scheduler/Scheduler.h

Issue 490913002: Adding flow traces for blink scheduler events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removal of accidental changes to Scheduler Tests Created 6 years, 4 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: Source/platform/scheduler/Scheduler.h
diff --git a/Source/platform/scheduler/Scheduler.h b/Source/platform/scheduler/Scheduler.h
index 2467766d4857b3f0e13684574993d0670f2a8e3a..e9afcee99be231cbf79fb8b84decb52311d4bf85 100644
--- a/Source/platform/scheduler/Scheduler.h
+++ b/Source/platform/scheduler/Scheduler.h
@@ -18,6 +18,8 @@ class WebThread;
namespace blink {
+typedef long long unsigned FlowTraceID;
Sami 2014/08/20 14:20:57 Probably better to use int64_t for this. Actually,
picksi1 2014/08/29 14:11:28 Changed to an int so keep atomicincrement happy
+
// The scheduler is an opinionated gateway for arranging work to be run on the
// main thread. It decides which tasks get priority over others based on a
// scheduling policy and the overall system state.
@@ -37,6 +39,7 @@ public:
void postInputTask(const TraceLocation&, const Task&);
void postCompositorTask(const TraceLocation&, const Task&);
void postTask(const TraceLocation&, const Task&); // For generic (low priority) tasks.
+
void postIdleTask(const TraceLocation&, const IdleTask&); // For non-critical tasks which may be reordered relative to other task types.
// Returns true if there is high priority work pending on the main thread
@@ -60,10 +63,10 @@ private:
~Scheduler();
void scheduleIdleTask(const TraceLocation&, const IdleTask&);
-
static void sharedTimerAdapter();
void tickSharedTimer();
+
bool hasPendingHighPriorityWork() const;
void runHighPriorityTasks();
@@ -71,15 +74,27 @@ private:
class TracedTask {
public:
- TracedTask(const Task& task, const TraceLocation& location)
- : m_task(task)
- , m_location(location) { }
+
+ enum Type {
+ Compositor,
+ Input,
+ MainThread,
+ TypeCount
+ };
+
+ TracedTask(const Task&, const TraceLocation&, Type);
+ static void setTypeName(Type, char const*);
void run();
+ FlowTraceID m_FlowTraceID;
Sami 2014/08/20 14:20:57 s/m_FlowTraceID/m_flowTraceID/
picksi1 2014/08/29 14:11:28 This is no longer static in latest version
+
private:
Task m_task;
TraceLocation m_location;
+ Type m_type;
Sami 2014/08/20 14:20:57 Instead of having a type enum, could we just pass
picksi1 2014/08/29 14:11:28 Done.
+ static FlowTraceID s_NextFlowTraceID;
+ static char const* s_typeNames[Type::TypeCount];
};
// Should only be accessed from the main thread.

Powered by Google App Engine
This is Rietveld 408576698