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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc

Issue 2778123003: [scheduler] Add WakeupBudgetPool. (Closed)
Patch Set: Addressed comments Created 3 years, 7 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
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 #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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 } 684 }
685 685
686 base::AutoLock lock(immediate_incoming_queue_lock_); 686 base::AutoLock lock(immediate_incoming_queue_lock_);
687 if (immediate_incoming_queue().empty()) 687 if (immediate_incoming_queue().empty())
688 return true; 688 return true;
689 689
690 return immediate_incoming_queue().front().enqueue_order() > 690 return immediate_incoming_queue().front().enqueue_order() >
691 main_thread_only().current_fence; 691 main_thread_only().current_fence;
692 } 692 }
693 693
694 bool TaskQueueImpl::HasFence() const {
695 return !!main_thread_only().current_fence;
696 }
697
694 bool TaskQueueImpl::CouldTaskRun(EnqueueOrder enqueue_order) const { 698 bool TaskQueueImpl::CouldTaskRun(EnqueueOrder enqueue_order) const {
695 if (!IsQueueEnabled()) 699 if (!IsQueueEnabled())
696 return false; 700 return false;
697 701
698 if (!main_thread_only().current_fence) 702 if (!main_thread_only().current_fence)
699 return true; 703 return true;
700 704
701 return enqueue_order < main_thread_only().current_fence; 705 return enqueue_order < main_thread_only().current_fence;
702 } 706 }
703 707
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 } 905 }
902 906
903 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) { 907 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) {
904 if (main_thread_only().observer) 908 if (main_thread_only().observer)
905 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up); 909 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up);
906 } 910 }
907 911
908 } // namespace internal 912 } // namespace internal
909 } // namespace scheduler 913 } // namespace scheduler
910 } // namespace blink 914 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698