| OLD | NEW |
| 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 #include "platform/scheduler/base/task_queue_impl.h" | 5 #include "platform/scheduler/base/task_queue_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 void TaskQueueImpl::ScheduleDelayedWorkInTimeDomain(base::TimeTicks now) { | 883 void TaskQueueImpl::ScheduleDelayedWorkInTimeDomain(base::TimeTicks now) { |
| 884 if (!IsQueueEnabled()) | 884 if (!IsQueueEnabled()) |
| 885 return; | 885 return; |
| 886 if (main_thread_only().delayed_incoming_queue.empty()) | 886 if (main_thread_only().delayed_incoming_queue.empty()) |
| 887 return; | 887 return; |
| 888 | 888 |
| 889 main_thread_only().time_domain->ScheduleDelayedWork( | 889 main_thread_only().time_domain->ScheduleDelayedWork( |
| 890 this, main_thread_only().delayed_incoming_queue.top().delayed_wake_up(), | 890 this, main_thread_only().delayed_incoming_queue.top().delayed_wake_up(), |
| 891 now); | 891 now); |
| 892 | 892 |
| 893 if (!HasPendingImmediateWork()) { | 893 NotifyWakeUpChangedOnMainThread( |
| 894 NotifyWakeUpChangedOnMainThread( | 894 main_thread_only().delayed_incoming_queue.top().delayed_run_time); |
| 895 main_thread_only().delayed_incoming_queue.top().delayed_run_time); | |
| 896 } | |
| 897 } | 895 } |
| 898 | 896 |
| 899 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) { | 897 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) { |
| 900 if (main_thread_only().observer) | 898 if (main_thread_only().observer) |
| 901 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up); | 899 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up); |
| 902 } | 900 } |
| 903 | 901 |
| 904 } // namespace internal | 902 } // namespace internal |
| 905 } // namespace scheduler | 903 } // namespace scheduler |
| 906 } // namespace blink | 904 } // namespace blink |
| OLD | NEW |