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

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

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/test/test_now_source.h » ('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 <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 #include <sstream> 9 #include <sstream>
10 #include <string> 10 #include <string>
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 TRACE_TASK("OrderedSimpleTaskRunner::PostNonNestableDelayedTask", pt); 120 TRACE_TASK("OrderedSimpleTaskRunner::PostNonNestableDelayedTask", pt);
121 pending_tasks_.insert(pt); 121 pending_tasks_.insert(pt);
122 return true; 122 return true;
123 } 123 }
124 124
125 bool OrderedSimpleTaskRunner::RunsTasksOnCurrentThread() const { 125 bool OrderedSimpleTaskRunner::RunsTasksOnCurrentThread() const {
126 DCHECK(thread_checker_.CalledOnValidThread()); 126 DCHECK(thread_checker_.CalledOnValidThread());
127 return true; 127 return true;
128 } 128 }
129 129
130 size_t OrderedSimpleTaskRunner::NumPendingTasks() const {
131 return pending_tasks_.size();
132 }
133
130 bool OrderedSimpleTaskRunner::HasPendingTasks() const { 134 bool OrderedSimpleTaskRunner::HasPendingTasks() const {
131 return pending_tasks_.size() > 0; 135 return pending_tasks_.size() > 0;
132 } 136 }
133 137
134 base::TimeTicks OrderedSimpleTaskRunner::NextTaskTime() { 138 base::TimeTicks OrderedSimpleTaskRunner::NextTaskTime() {
135 if (pending_tasks_.size() <= 0) { 139 if (pending_tasks_.size() <= 0) {
136 return TestNowSource::kAbsoluteMaxNow; 140 return TestNowSource::kAbsoluteMaxNow;
137 } 141 }
138 142
139 return pending_tasks_.begin()->GetTimeToRun(); 143 return pending_tasks_.begin()->GetTimeToRun();
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 329
326 bool OrderedSimpleTaskRunner::AdvanceNowCallback() { 330 bool OrderedSimpleTaskRunner::AdvanceNowCallback() {
327 base::TimeTicks next_task_time = NextTaskTime(); 331 base::TimeTicks next_task_time = NextTaskTime();
328 if (now_src_->Now() < next_task_time) { 332 if (now_src_->Now() < next_task_time) {
329 now_src_->SetNow(next_task_time); 333 now_src_->SetNow(next_task_time);
330 } 334 }
331 return true; 335 return true;
332 } 336 }
333 337
334 } // namespace cc 338 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/ordered_simple_task_runner.h ('k') | cc/test/test_now_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698