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

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

Issue 2778123003: [scheduler] Add WakeupBudgetPool. (Closed)
Patch Set: Rebased & addressed comments from skyostil@ and alexclarke@ 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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698