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

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: Straggling uin64 turned into an int 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 654764e53723ef12efb4cb601b124f88e5c426d2..13624792f637c7ff9f5bed88195d1c2267265826 100644
--- a/Source/platform/scheduler/Scheduler.h
+++ b/Source/platform/scheduler/Scheduler.h
@@ -6,7 +6,7 @@
#define Scheduler_h
#include "platform/PlatformExport.h"
-#include "platform/TraceLocation.h"
+#include "platform/scheduler/TracedTask.h"
#include "wtf/DoubleBufferedDeque.h"
#include "wtf/Functional.h"
#include "wtf/Noncopyable.h"
@@ -56,27 +56,16 @@ private:
friend class MainThreadPendingTaskRunner;
friend class MainThreadPendingHighPriorityTaskRunner;
- class TracedTask {
- public:
- TracedTask(const Task& task, const TraceLocation& location)
- : m_task(task)
- , m_location(location) { }
-
- void run();
-
- private:
- Task m_task;
- TraceLocation m_location;
- };
-
Scheduler();
~Scheduler();
void scheduleIdleTask(const TraceLocation&, const IdleTask&);
+ void postAsHighPriorityTask(const TraceLocation&, const Task&, const char*);
Sami 2014/08/29 14:50:25 It's not clear what the char* parameter is so it s
picksi1 2014/09/01 11:06:51 Done.
static void sharedTimerAdapter();
void tickSharedTimer();
+
bool hasPendingHighPriorityWork() const;
bool swapQueuesAndRunPendingTasks();
void swapQueuesRunPendingTasksAndAllowHighPriorityTaskRunnerPosting();
@@ -87,6 +76,8 @@ private:
// Must be called while m_pendingTasksMutex is locked.
void maybePostMainThreadPendingHighPriorityTaskRunner();
+ int generateFlowTraceID();
+
static Scheduler* s_sharedScheduler;
// Should only be accessed from the main thread.
@@ -99,7 +90,10 @@ private:
Mutex m_pendingTasksMutex;
DoubleBufferedDeque<TracedTask> m_pendingHighPriorityTasks;
+ // Declared volatile as they are atomically incremented.
volatile int m_highPriorityTaskCount;
+ volatile int m_nextFlowTraceID;
+
bool m_highPriorityTaskRunnerPosted;
};

Powered by Google App Engine
This is Rietveld 408576698