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 #ifndef BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ | 5 #ifndef BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ |
6 #define BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ | 6 #define BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <vector> | 10 #include <vector> |
(...skipping 15 matching lines...) Expand all Loading... |
26 // An immutable struct combining a Sequence and the sort key that determines | 26 // An immutable struct combining a Sequence and the sort key that determines |
27 // its position in a PriorityQueue. | 27 // its position in a PriorityQueue. |
28 struct BASE_EXPORT SequenceAndSortKey { | 28 struct BASE_EXPORT SequenceAndSortKey { |
29 // Constructs a null SequenceAndSortKey. | 29 // Constructs a null SequenceAndSortKey. |
30 SequenceAndSortKey(); | 30 SequenceAndSortKey(); |
31 | 31 |
32 // Constructs a SequenceAndSortKey with the given |sequence| and |sort_key|. | 32 // Constructs a SequenceAndSortKey with the given |sequence| and |sort_key|. |
33 SequenceAndSortKey(scoped_refptr<Sequence> sequence, | 33 SequenceAndSortKey(scoped_refptr<Sequence> sequence, |
34 const SequenceSortKey& sort_key); | 34 const SequenceSortKey& sort_key); |
35 | 35 |
| 36 SequenceAndSortKey(const SequenceAndSortKey& other); |
| 37 |
36 ~SequenceAndSortKey(); | 38 ~SequenceAndSortKey(); |
37 | 39 |
38 // Returns true if this is a null SequenceAndSortKey. | 40 // Returns true if this is a null SequenceAndSortKey. |
39 bool is_null() const { return !sequence; } | 41 bool is_null() const { return !sequence; } |
40 | 42 |
41 const scoped_refptr<Sequence> sequence; | 43 const scoped_refptr<Sequence> sequence; |
42 const SequenceSortKey sort_key; | 44 const SequenceSortKey sort_key; |
43 }; | 45 }; |
44 | 46 |
45 // A Transaction can perform multiple operations atomically on a | 47 // A Transaction can perform multiple operations atomically on a |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // empty. | 120 // empty. |
119 const SequenceAndSortKey empty_sequence_and_sort_key_; | 121 const SequenceAndSortKey empty_sequence_and_sort_key_; |
120 | 122 |
121 DISALLOW_COPY_AND_ASSIGN(PriorityQueue); | 123 DISALLOW_COPY_AND_ASSIGN(PriorityQueue); |
122 }; | 124 }; |
123 | 125 |
124 } // namespace internal | 126 } // namespace internal |
125 } // namespace base | 127 } // namespace base |
126 | 128 |
127 #endif // BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ | 129 #endif // BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ |
OLD | NEW |