Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Side by Side Diff: cc/test/ordered_simple_task_runner.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: rebase & remove inline keyword Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/ordered_simple_task_runner.h ('k') | cc/tiles/image_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/test/ordered_simple_task_runner.h ('k') | cc/tiles/image_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698