Commit 0efc945a authored by Greg Kraynov's avatar Greg Kraynov Committed by Commit Bot

Blink Scheduler: Remove WTF references from scheduler/base.

It's getting moved to //base, hence, can't use WTF.
base::circular_deque seems to be a drop-in replacement to WTF::Deque.

Bug: 783309
Change-Id: I3d92842687b1021d69afe98c374e998517daa369
Reviewed-on: https://chromium-review.googlesource.com/1009909Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Commit-Queue: Greg Kraynov <kraynov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554367}
parent 310b054f
...@@ -13,6 +13,7 @@ include_rules = [ ...@@ -13,6 +13,7 @@ include_rules = [
"+base/cancelable_callback.h", "+base/cancelable_callback.h",
"+base/command_line.h", "+base/command_line.h",
"+base/compiler_specific.h", "+base/compiler_specific.h",
"+base/containers/circular_deque.h",
"+base/containers/small_map.h", "+base/containers/small_map.h",
"+base/feature_list.h", "+base/feature_list.h",
"+base/format_macros.h", "+base/format_macros.h",
......
...@@ -155,7 +155,7 @@ void TaskQueueImpl::UnregisterTaskQueue() { ...@@ -155,7 +155,7 @@ void TaskQueueImpl::UnregisterTaskQueue() {
OnNextWakeUpChangedCallback(); OnNextWakeUpChangedCallback();
main_thread_only().on_next_wake_up_changed_callback = main_thread_only().on_next_wake_up_changed_callback =
OnNextWakeUpChangedCallback(); OnNextWakeUpChangedCallback();
immediate_incoming_queue.Swap(immediate_incoming_queue_); immediate_incoming_queue.swap(immediate_incoming_queue_);
} }
// It is possible for a task to hold a scoped_refptr to this, which // It is possible for a task to hold a scoped_refptr to this, which
...@@ -342,7 +342,7 @@ void TaskQueueImpl::ReloadImmediateWorkQueueIfEmpty() { ...@@ -342,7 +342,7 @@ void TaskQueueImpl::ReloadImmediateWorkQueueIfEmpty() {
TaskQueueImpl::TaskDeque TaskQueueImpl::TakeImmediateIncomingQueue() { TaskQueueImpl::TaskDeque TaskQueueImpl::TakeImmediateIncomingQueue() {
base::AutoLock immediate_incoming_queue_lock(immediate_incoming_queue_lock_); base::AutoLock immediate_incoming_queue_lock(immediate_incoming_queue_lock_);
TaskQueueImpl::TaskDeque queue; TaskQueueImpl::TaskDeque queue;
queue.Swap(immediate_incoming_queue()); queue.swap(immediate_incoming_queue());
// Activate delayed fence if necessary. This is ideologically similar to // Activate delayed fence if necessary. This is ideologically similar to
// ActivateDelayedFenceIfNeeded, but due to immediate tasks being posted // ActivateDelayedFenceIfNeeded, but due to immediate tasks being posted
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <set> #include <set>
#include "base/callback.h" #include "base/callback.h"
#include "base/containers/circular_deque.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
...@@ -23,7 +24,6 @@ ...@@ -23,7 +24,6 @@
#include "third_party/blink/renderer/platform/scheduler/base/intrusive_heap.h" #include "third_party/blink/renderer/platform/scheduler/base/intrusive_heap.h"
#include "third_party/blink/renderer/platform/scheduler/base/sequenced_task_source.h" #include "third_party/blink/renderer/platform/scheduler/base/sequenced_task_source.h"
#include "third_party/blink/renderer/platform/scheduler/base/task_queue.h" #include "third_party/blink/renderer/platform/scheduler/base/task_queue.h"
#include "third_party/blink/renderer/platform/wtf/deque.h"
namespace blink { namespace blink {
namespace scheduler { namespace scheduler {
...@@ -372,7 +372,7 @@ class PLATFORM_EXPORT TaskQueueImpl { ...@@ -372,7 +372,7 @@ class PLATFORM_EXPORT TaskQueueImpl {
// We reserve an inline capacity of 8 tasks to try and reduce the load on // We reserve an inline capacity of 8 tasks to try and reduce the load on
// PartitionAlloc. // PartitionAlloc.
using TaskDeque = WTF::Deque<Task, 8>; using TaskDeque = base::circular_deque<Task>;
// Extracts all the tasks from the immediate incoming queue and clears it. // Extracts all the tasks from the immediate incoming queue and clears it.
// Can be called from any thread. // Can be called from any thread.
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/atomic_sequence_num.h" #include "base/atomic_sequence_num.h"
#include "base/cancelable_callback.h" #include "base/cancelable_callback.h"
#include "base/containers/circular_deque.h"
#include "base/debug/task_annotator.h" #include "base/debug/task_annotator.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
...@@ -175,7 +176,7 @@ class PLATFORM_EXPORT TaskQueueManagerImpl ...@@ -175,7 +176,7 @@ class PLATFORM_EXPORT TaskQueueManagerImpl
internal::TaskQueueImpl* task_queue; internal::TaskQueueImpl* task_queue;
WorkType work_type; WorkType work_type;
}; };
using NonNestableTaskDeque = WTF::Deque<NonNestableTask, 8>; using NonNestableTaskDeque = base::circular_deque<NonNestableTask>;
// We have to track rentrancy because we support nested runloops but the // We have to track rentrancy because we support nested runloops but the
// selector interface is unaware of those. This struct keeps track off all // selector interface is unaware of those. This struct keeps track off all
......
...@@ -130,7 +130,8 @@ TaskQueueImpl::Task WorkQueue::TakeTaskFromWorkQueue() { ...@@ -130,7 +130,8 @@ TaskQueueImpl::Task WorkQueue::TakeTaskFromWorkQueue() {
DCHECK(work_queue_sets_); DCHECK(work_queue_sets_);
DCHECK(!tasks_.empty()); DCHECK(!tasks_.empty());
TaskQueueImpl::Task pending_task = tasks_.TakeFirst(); TaskQueueImpl::Task pending_task = std::move(tasks_.front());
tasks_.pop_front();
// NB immediate tasks have a different pipeline to delayed ones. // NB immediate tasks have a different pipeline to delayed ones.
if (queue_type_ == QueueType::kImmediate && tasks_.empty()) { if (queue_type_ == QueueType::kImmediate && tasks_.empty()) {
// Short-circuit the queue reload so that OnPopQueue does the right thing. // Short-circuit the queue reload so that OnPopQueue does the right thing.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment