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

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

Issue 595023002: Implement idle task scheduling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « no previous file | Source/platform/scheduler/Scheduler.cpp » ('j') | Source/platform/scheduler/Scheduler.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scheduler/Scheduler.h
diff --git a/Source/platform/scheduler/Scheduler.h b/Source/platform/scheduler/Scheduler.h
index 7f7835abcf76d6ac90c6780e6fdad520e3808d80..86ab076cdbb4c1a4137e0ef59e245975a19ffacd 100644
--- a/Source/platform/scheduler/Scheduler.h
+++ b/Source/platform/scheduler/Scheduler.h
@@ -10,6 +10,7 @@
#include "wtf/DoubleBufferedDeque.h"
#include "wtf/Functional.h"
#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
#include "wtf/ThreadingPrimitives.h"
namespace blink {
@@ -64,6 +65,7 @@ protected:
class MainThreadPendingHighPriorityTaskRunner;
friend class MainThreadPendingTaskRunner;
friend class MainThreadPendingHighPriorityTaskRunner;
+ friend class TracedIdleTask;
enum SchedulerPolicy {
Normal,
@@ -73,8 +75,8 @@ protected:
Scheduler();
virtual ~Scheduler();
- void scheduleIdleTask(const TraceLocation&, const IdleTask&);
void postHighPriorityTaskInternal(const TraceLocation&, const Task&, const char* traceName);
+ void postIdleTaskInternal(const TraceLocation&, const IdleTask&, const char* traceName);
static void sharedTimerAdapter();
@@ -89,7 +91,19 @@ protected:
void swapQueuesRunPendingTasksAndAllowHighPriorityTaskRunnerPosting();
// Returns true if any work was done.
- bool executeHighPriorityTasks(Deque<TracedTask>&);
+ bool executeHighPriorityTasks(Deque<OwnPtr<TracedTask> >&);
+
+ // Returns true if any work was done.
+ bool swapQueuesAndRunPendingIdleTasks();
+
+ // Returns true if any work was done.
+ bool executeIdleTasks(Deque<OwnPtr<TracedTask> >&);
+
+ // Reposts all the tasks in idleTasks onto the idle task queue.
+ void repostAllIdleTasks(Deque<OwnPtr<TracedTask> >&);
+
+ // Returns the time in seconds until the current frame deadline expires.
+ double getSecondsUntilFrameDeadline() const;
Sami 2014/09/24 14:00:40 nit: drop the |get|, it's cleaner
rmcilroy 2014/09/29 17:42:57 Done.
// Return the current SchedulerPolicy.
SchedulerPolicy schedulerPolicy() const;
@@ -118,9 +132,12 @@ protected:
// This mutex protects calls to the pending task queue, m_highPriorityTaskRunnerPosted and
// m_compositorPriorityPolicyEndTimeSeconds.
Mutex m_pendingTasksMutex;
- DoubleBufferedDeque<TracedTask> m_pendingHighPriorityTasks;
+ DoubleBufferedDeque<OwnPtr<TracedTask> > m_pendingHighPriorityTasks;
Sami 2014/09/24 14:00:40 As of Nico's email to chromium-dev@ yesterday I th
rmcilroy 2014/09/29 17:42:57 Acknowledged.
+ DoubleBufferedDeque<OwnPtr<TracedTask> > m_pendingIdleTasks;
double m_compositorPriorityPolicyEndTimeSeconds;
+ double m_currentFrameDeadlineSeconds;
+
// Declared volatile as it is atomically incremented.
volatile int m_highPriorityTaskCount;
« no previous file with comments | « no previous file | Source/platform/scheduler/Scheduler.cpp » ('j') | Source/platform/scheduler/Scheduler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698