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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 } | 683 } |
684 | 684 |
685 base::AutoLock lock(immediate_incoming_queue_lock_); | 685 base::AutoLock lock(immediate_incoming_queue_lock_); |
686 if (immediate_incoming_queue().empty()) | 686 if (immediate_incoming_queue().empty()) |
687 return true; | 687 return true; |
688 | 688 |
689 return immediate_incoming_queue().front().enqueue_order() > | 689 return immediate_incoming_queue().front().enqueue_order() > |
690 main_thread_only().current_fence; | 690 main_thread_only().current_fence; |
691 } | 691 } |
692 | 692 |
| 693 bool TaskQueueImpl::HasFence() const { |
| 694 return !!main_thread_only().current_fence; |
| 695 } |
| 696 |
693 bool TaskQueueImpl::CouldTaskRun(EnqueueOrder enqueue_order) const { | 697 bool TaskQueueImpl::CouldTaskRun(EnqueueOrder enqueue_order) const { |
694 if (!IsQueueEnabled()) | 698 if (!IsQueueEnabled()) |
695 return false; | 699 return false; |
696 | 700 |
697 if (!main_thread_only().current_fence) | 701 if (!main_thread_only().current_fence) |
698 return true; | 702 return true; |
699 | 703 |
700 return enqueue_order < main_thread_only().current_fence; | 704 return enqueue_order < main_thread_only().current_fence; |
701 } | 705 } |
702 | 706 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 } | 899 } |
896 | 900 |
897 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) { | 901 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) { |
898 if (main_thread_only().observer) | 902 if (main_thread_only().observer) |
899 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up); | 903 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up); |
900 } | 904 } |
901 | 905 |
902 } // namespace internal | 906 } // namespace internal |
903 } // namespace scheduler | 907 } // namespace scheduler |
904 } // namespace blink | 908 } // namespace blink |
OLD | NEW |