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

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

Issue 2419793002: [Reland] Optimize blink scheduler with an intrusive heap (Closed)
Patch Set: Tiny optimization of MoveHoleDownAndFillWithLeafElement Created 4 years, 2 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/work_queue.h" 5 #include "platform/scheduler/base/work_queue.h"
6 6
7 #include "platform/scheduler/base/work_queue_sets.h" 7 #include "platform/scheduler/base/work_queue_sets.h"
8 8
9 namespace blink { 9 namespace blink {
10 namespace scheduler { 10 namespace scheduler {
11 namespace internal { 11 namespace internal {
12 12
13 WorkQueue::WorkQueue(TaskQueueImpl* task_queue, const char* name) 13 WorkQueue::WorkQueue(TaskQueueImpl* task_queue, const char* name)
14 : work_queue_sets_(nullptr), 14 : work_queue_sets_(nullptr),
15 task_queue_(task_queue), 15 task_queue_(task_queue),
16 work_queue_set_index_(0), 16 work_queue_set_index_(0),
17 heap_index_(0),
17 name_(name), 18 name_(name),
18 fence_(0) {} 19 fence_(0) {}
19 20
20 void WorkQueue::AsValueInto(base::trace_event::TracedValue* state) const { 21 void WorkQueue::AsValueInto(base::trace_event::TracedValue* state) const {
21 // Remove const to search |work_queue_| in the destructive manner. Restore the 22 // Remove const to search |work_queue_| in the destructive manner. Restore the
22 // content from |visited| later. 23 // content from |visited| later.
23 std::queue<TaskQueueImpl::Task>* mutable_queue = 24 std::queue<TaskQueueImpl::Task>* mutable_queue =
24 const_cast<std::queue<TaskQueueImpl::Task>*>(&work_queue_); 25 const_cast<std::queue<TaskQueueImpl::Task>*>(&work_queue_);
25 std::queue<TaskQueueImpl::Task> visited; 26 std::queue<TaskQueueImpl::Task> visited;
26 while (!mutable_queue->empty()) { 27 while (!mutable_queue->empty()) {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 bool have_other_task = 163 bool have_other_task =
163 other_queue->GetFrontTaskEnqueueOrder(&other_enqueue_order); 164 other_queue->GetFrontTaskEnqueueOrder(&other_enqueue_order);
164 DCHECK(have_task); 165 DCHECK(have_task);
165 DCHECK(have_other_task); 166 DCHECK(have_other_task);
166 return enqueue_order < other_enqueue_order; 167 return enqueue_order < other_enqueue_order;
167 } 168 }
168 169
169 } // namespace internal 170 } // namespace internal
170 } // namespace scheduler 171 } // namespace scheduler
171 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698