OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/test/ordered_simple_task_runner.h" | 5 #include "cc/test/ordered_simple_task_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 base::TimeDelta delay) { | 126 base::TimeDelta delay) { |
127 DCHECK(thread_checker_.CalledOnValidThread()); | 127 DCHECK(thread_checker_.CalledOnValidThread()); |
128 TestOrderablePendingTask pt(from_here, std::move(task), now_src_->NowTicks(), | 128 TestOrderablePendingTask pt(from_here, std::move(task), now_src_->NowTicks(), |
129 delay, base::TestPendingTask::NON_NESTABLE); | 129 delay, base::TestPendingTask::NON_NESTABLE); |
130 | 130 |
131 TRACE_TASK("OrderedSimpleTaskRunner::PostNonNestableDelayedTask", pt); | 131 TRACE_TASK("OrderedSimpleTaskRunner::PostNonNestableDelayedTask", pt); |
132 pending_tasks_.insert(std::move(pt)); | 132 pending_tasks_.insert(std::move(pt)); |
133 return true; | 133 return true; |
134 } | 134 } |
135 | 135 |
136 bool OrderedSimpleTaskRunner::RunsTasksOnCurrentThread() const { | 136 bool OrderedSimpleTaskRunner::RunsTasksInCurrentSequence() const { |
137 DCHECK(thread_checker_.CalledOnValidThread()); | 137 DCHECK(thread_checker_.CalledOnValidThread()); |
138 return true; | 138 return true; |
139 } | 139 } |
140 | 140 |
141 size_t OrderedSimpleTaskRunner::NumPendingTasks() const { | 141 size_t OrderedSimpleTaskRunner::NumPendingTasks() const { |
142 return pending_tasks_.size(); | 142 return pending_tasks_.size(); |
143 } | 143 } |
144 | 144 |
145 bool OrderedSimpleTaskRunner::HasPendingTasks() const { | 145 bool OrderedSimpleTaskRunner::HasPendingTasks() const { |
146 return pending_tasks_.size() > 0; | 146 return pending_tasks_.size() > 0; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 while (it != pending_tasks_.end()) { | 374 while (it != pending_tasks_.end()) { |
375 if (it->task.IsCancelled()) { | 375 if (it->task.IsCancelled()) { |
376 it = pending_tasks_.erase(it); | 376 it = pending_tasks_.erase(it); |
377 } else { | 377 } else { |
378 it++; | 378 it++; |
379 } | 379 } |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 } // namespace cc | 383 } // namespace cc |
OLD | NEW |