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 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 outer_queue_->container_.pop(); | 88 outer_queue_->container_.pop(); |
89 return sequence; | 89 return sequence; |
90 } | 90 } |
91 | 91 |
92 bool PriorityQueue::Transaction::IsEmpty() const { | 92 bool PriorityQueue::Transaction::IsEmpty() const { |
93 return outer_queue_->container_.empty(); | 93 return outer_queue_->container_.empty(); |
94 } | 94 } |
95 | 95 |
96 PriorityQueue::PriorityQueue() = default; | 96 PriorityQueue::PriorityQueue() = default; |
97 | 97 |
98 PriorityQueue::PriorityQueue(const PriorityQueue* predecessor_priority_queue) | |
99 : container_lock_(&predecessor_priority_queue->container_lock_) { | |
100 DCHECK(predecessor_priority_queue); | |
101 } | |
102 | |
103 PriorityQueue::~PriorityQueue() = default; | 98 PriorityQueue::~PriorityQueue() = default; |
104 | 99 |
105 std::unique_ptr<PriorityQueue::Transaction> PriorityQueue::BeginTransaction() { | 100 std::unique_ptr<PriorityQueue::Transaction> PriorityQueue::BeginTransaction() { |
106 return WrapUnique(new Transaction(this)); | 101 return WrapUnique(new Transaction(this)); |
107 } | 102 } |
108 | 103 |
109 } // namespace internal | 104 } // namespace internal |
110 } // namespace base | 105 } // namespace base |
OLD | NEW |