| 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 "components/scheduler/base/work_queue.h" | 5 #include "components/scheduler/base/work_queue.h" |
| 6 | 6 |
| 7 #include "components/scheduler/base/work_queue_sets.h" | 7 #include "components/scheduler/base/work_queue_sets.h" |
| 8 | 8 |
| 9 namespace scheduler { | 9 namespace scheduler { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 work_queue_sets_ = work_queue_sets; | 84 work_queue_sets_ = work_queue_sets; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void WorkQueue::AssignSetIndex(size_t work_queue_set_index) { | 87 void WorkQueue::AssignSetIndex(size_t work_queue_set_index) { |
| 88 work_queue_set_index_ = work_queue_set_index; | 88 work_queue_set_index_ = work_queue_set_index; |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool WorkQueue::ShouldRunBefore(const WorkQueue* other_queue) const { | 91 bool WorkQueue::ShouldRunBefore(const WorkQueue* other_queue) const { |
| 92 DCHECK(!work_queue_.empty()); | 92 DCHECK(!work_queue_.empty()); |
| 93 DCHECK(!other_queue->work_queue_.empty()); | 93 DCHECK(!other_queue->work_queue_.empty()); |
| 94 EnqueueOrder enqueue_order; | 94 EnqueueOrder enqueue_order = 0; |
| 95 EnqueueOrder other_enqueue_order; | 95 EnqueueOrder other_enqueue_order = 0; |
| 96 bool have_task = GetFrontTaskEnqueueOrder(&enqueue_order); | 96 bool have_task = GetFrontTaskEnqueueOrder(&enqueue_order); |
| 97 bool have_other_task = | 97 bool have_other_task = |
| 98 other_queue->GetFrontTaskEnqueueOrder(&other_enqueue_order); | 98 other_queue->GetFrontTaskEnqueueOrder(&other_enqueue_order); |
| 99 DCHECK(have_task); | 99 DCHECK(have_task); |
| 100 DCHECK(have_other_task); | 100 DCHECK(have_other_task); |
| 101 return enqueue_order < other_enqueue_order; | 101 return enqueue_order < other_enqueue_order; |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace internal | 104 } // namespace internal |
| 105 } // namespace scheduler | 105 } // namespace scheduler |
| OLD | NEW |