| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |