OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/task_scheduler/priority_queue.h" | 5 #include "base/task_scheduler/priority_queue.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 PriorityQueue::SequenceAndSortKey::SequenceAndSortKey() | 14 PriorityQueue::SequenceAndSortKey::SequenceAndSortKey() = default; |
15 : sort_key(TaskPriority::LOWEST, TimeTicks()) {} | |
16 | 15 |
17 PriorityQueue::SequenceAndSortKey::SequenceAndSortKey( | 16 PriorityQueue::SequenceAndSortKey::SequenceAndSortKey( |
18 scoped_refptr<Sequence> sequence, | 17 scoped_refptr<Sequence> sequence, |
19 SequenceSortKey sort_key) | 18 SequenceSortKey sort_key) |
20 : sequence(sequence), sort_key(sort_key) {} | 19 : sequence(sequence), sort_key(sort_key) {} |
21 | 20 |
22 PriorityQueue::SequenceAndSortKey::~SequenceAndSortKey() = default; | 21 PriorityQueue::SequenceAndSortKey::~SequenceAndSortKey() = default; |
23 | 22 |
24 bool PriorityQueue::SequenceAndSortKey::is_null() const { | 23 bool PriorityQueue::SequenceAndSortKey::is_null() const { |
25 return sequence.get() == nullptr; | 24 return sequence.get() == nullptr; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 87 } |
89 | 88 |
90 bool PriorityQueue::SequenceAndSortKeyComparator::operator()( | 89 bool PriorityQueue::SequenceAndSortKeyComparator::operator()( |
91 const scoped_ptr<SequenceAndSortKey>& left, | 90 const scoped_ptr<SequenceAndSortKey>& left, |
92 const scoped_ptr<SequenceAndSortKey>& right) const { | 91 const scoped_ptr<SequenceAndSortKey>& right) const { |
93 return left->sort_key < right->sort_key; | 92 return left->sort_key < right->sort_key; |
94 } | 93 } |
95 | 94 |
96 } // namespace internal | 95 } // namespace internal |
97 } // namespace base | 96 } // namespace base |
OLD | NEW |