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

Side by Side Diff: components/scheduler/base/task_queue_impl.h

Issue 2155143002: Fix a bug that could occasionaly cause setInterval to stop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ClearExpiredWakeups tweak. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « components/scheduler/base/task_queue.h ('k') | components/scheduler/base/task_queue_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_
6 #define CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ 6 #define CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const base::Closure& task, 91 const base::Closure& task,
92 base::TimeDelta delay) override; 92 base::TimeDelta delay) override;
93 93
94 void SetQueueEnabled(bool enabled) override; 94 void SetQueueEnabled(bool enabled) override;
95 bool IsQueueEnabled() const override; 95 bool IsQueueEnabled() const override;
96 bool IsEmpty() const override; 96 bool IsEmpty() const override;
97 bool HasPendingImmediateWork() const override; 97 bool HasPendingImmediateWork() const override;
98 bool NeedsPumping() const override; 98 bool NeedsPumping() const override;
99 void SetQueuePriority(QueuePriority priority) override; 99 void SetQueuePriority(QueuePriority priority) override;
100 QueuePriority GetQueuePriority() const override; 100 QueuePriority GetQueuePriority() const override;
101 void PumpQueue(bool may_post_dowork) override; 101 void PumpQueue(LazyNow* lazy_now, bool may_post_dowork) override;
102 void SetPumpPolicy(PumpPolicy pump_policy) override; 102 void SetPumpPolicy(PumpPolicy pump_policy) override;
103 PumpPolicy GetPumpPolicy() const override; 103 PumpPolicy GetPumpPolicy() const override;
104 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; 104 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
105 void RemoveTaskObserver( 105 void RemoveTaskObserver(
106 base::MessageLoop::TaskObserver* task_observer) override; 106 base::MessageLoop::TaskObserver* task_observer) override;
107 void SetTimeDomain(TimeDomain* time_domain) override; 107 void SetTimeDomain(TimeDomain* time_domain) override;
108 TimeDomain* GetTimeDomain() const override; 108 TimeDomain* GetTimeDomain() const override;
109 void SetBlameContext(base::trace_event::BlameContext* blame_context) override; 109 void SetBlameContext(base::trace_event::BlameContext* blame_context) override;
110 110
111 void UpdateImmediateWorkQueue(bool should_trigger_wakeup, 111 void UpdateImmediateWorkQueue(bool should_trigger_wakeup,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 void ScheduleDelayedWorkTask(Task pending_task); 230 void ScheduleDelayedWorkTask(Task pending_task);
231 231
232 // Enqueues any delayed tasks which should be run now on the 232 // Enqueues any delayed tasks which should be run now on the
233 // |delayed_work_queue|. Must be called from the main thread. 233 // |delayed_work_queue|. Must be called from the main thread.
234 void MoveReadyDelayedTasksToDelayedWorkQueue(LazyNow* lazy_now); 234 void MoveReadyDelayedTasksToDelayedWorkQueue(LazyNow* lazy_now);
235 235
236 void MoveReadyImmediateTasksToImmediateWorkQueueLocked(); 236 void MoveReadyImmediateTasksToImmediateWorkQueueLocked();
237 237
238 // Note this does nothing if its not called from the main thread. 238 // Note this does nothing if its not called from the main thread.
239 void PumpQueueLocked(bool may_post_dowork); 239 void PumpQueueLocked(LazyNow* lazy_now, bool may_post_dowork);
240 240
241 // Returns true if |task| is older than the oldest incoming immediate task. 241 // Returns true if |task| is older than the oldest incoming immediate task.
242 // NOTE |any_thread_lock_| must be locked. 242 // NOTE |any_thread_lock_| must be locked.
243 bool TaskIsOlderThanQueuedImmediateTasksLocked(const Task* task); 243 bool TaskIsOlderThanQueuedImmediateTasksLocked(const Task* task);
244 244
245 // Returns true if |task| is older than the oldest delayed task. Must be 245 // Returns true if |task| is older than the oldest delayed task. Must be
246 // called from the main thread. 246 // called from the main thread.
247 bool TaskIsOlderThanQueuedDelayedTasks(const Task* task); 247 bool TaskIsOlderThanQueuedDelayedTasks(const Task* task);
248 248
249 // NOTE |any_thread_lock_| must be locked. 249 // NOTE |any_thread_lock_| must be locked.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 const bool should_notify_observers_; 300 const bool should_notify_observers_;
301 const bool should_report_when_execution_blocked_; 301 const bool should_report_when_execution_blocked_;
302 302
303 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); 303 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl);
304 }; 304 };
305 305
306 } // namespace internal 306 } // namespace internal
307 } // namespace scheduler 307 } // namespace scheduler
308 308
309 #endif // CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ 309 #endif // CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_
OLDNEW
« no previous file with comments | « components/scheduler/base/task_queue.h ('k') | components/scheduler/base/task_queue_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698