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

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: atomicIncrement only done if needed. ID generation moved into TracedTask. Created 6 years, 3 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 9524ec37a34d76596985ea4f2c438e84bb52dbef..717ca1a24cc6edde86df49f552674b573e5b9cfc 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"
@@ -60,23 +60,11 @@ 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 postHighPriorityTaskInternal(const TraceLocation&, const Task&, const char* traceName);
static void sharedTimerAdapter();
void tickSharedTimer();
@@ -103,7 +91,9 @@ private:
Mutex m_pendingTasksMutex;
DoubleBufferedDeque<TracedTask> m_pendingHighPriorityTasks;
+ // Declared volatile as they are atomically incremented.
Sami 2014/09/04 09:51:07 nit: s/they are/this is/.
picksi1 2014/09/05 08:28:33 Done.
volatile int m_highPriorityTaskCount;
+
bool m_highPriorityTaskRunnerPosted;
};

Powered by Google App Engine
This is Rietveld 408576698