 Chromium Code Reviews
 Chromium Code Reviews Issue 2258133002:
  [scheduler] Implement time-based cpu throttling.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 2258133002:
  [scheduler] Implement time-based cpu throttling.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc | 
| diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc | 
| index 1b0980a4f4e00ccf236f4bc2250683d0b744c3b7..2bd7aba0233369105e11c91b5d124aca6b8eb035 100644 | 
| --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc | 
| +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc | 
| @@ -533,6 +533,20 @@ bool TaskQueueImpl::HasPendingImmediateWork() const { | 
| return !any_thread().immediate_incoming_queue.empty(); | 
| } | 
| +bool TaskQueueImpl::NextScheduledWakeUp(base::TimeTicks* wakeup) { | 
| + LazyNow lazy_now = main_thread_only().time_domain->CreateLazyNow(); | 
| + MoveReadyDelayedTasksToDelayedWorkQueue(&lazy_now); | 
| + | 
| + if (main_thread_only().delayed_incoming_queue.empty()) | 
| + return false; | 
| + | 
| + if (wakeup) { | 
| 
alex clarke (OOO till 29th)
2016/09/07 15:13:07
I don't think we should allow |wakeup| to be null.
 
altimin
2016/09/09 15:43:57
Done.
 | 
| + *wakeup = | 
| + main_thread_only().delayed_incoming_queue.begin()->delayed_run_time; | 
| + } | 
| + return true; | 
| +} | 
| + | 
| void TaskQueueImpl::MoveReadyDelayedTasksToDelayedWorkQueue(LazyNow* lazy_now) { | 
| // Enqueue all delayed tasks that should be running now. | 
| while (!main_thread_only().delayed_incoming_queue.empty()) { |