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

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 from 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 } 689 }
690 690
691 base::AutoLock lock(immediate_incoming_queue_lock_); 691 base::AutoLock lock(immediate_incoming_queue_lock_);
692 if (immediate_incoming_queue().empty()) 692 if (immediate_incoming_queue().empty())
693 return true; 693 return true;
694 694
695 return immediate_incoming_queue().front().enqueue_order() > 695 return immediate_incoming_queue().front().enqueue_order() >
696 main_thread_only().current_fence; 696 main_thread_only().current_fence;
697 } 697 }
698 698
699 bool TaskQueueImpl::HasFence() const {
700 return !!main_thread_only().current_fence;
701 }
702
699 bool TaskQueueImpl::CouldTaskRun(EnqueueOrder enqueue_order) const { 703 bool TaskQueueImpl::CouldTaskRun(EnqueueOrder enqueue_order) const {
700 if (!IsQueueEnabled()) 704 if (!IsQueueEnabled())
701 return false; 705 return false;
702 706
703 if (!main_thread_only().current_fence) 707 if (!main_thread_only().current_fence)
704 return true; 708 return true;
705 709
706 return enqueue_order < main_thread_only().current_fence; 710 return enqueue_order < main_thread_only().current_fence;
707 } 711 }
708 712
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 } 907 }
904 908
905 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) { 909 void TaskQueueImpl::NotifyWakeUpChangedOnMainThread(base::TimeTicks wake_up) {
906 if (main_thread_only().observer) 910 if (main_thread_only().observer)
907 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up); 911 main_thread_only().observer->OnQueueNextWakeUpChanged(this, wake_up);
908 } 912 }
909 913
910 } // namespace internal 914 } // namespace internal
911 } // namespace scheduler 915 } // namespace scheduler
912 } // namespace blink 916 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698