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

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

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/layer_tree_test.cc ('k') | cc/test/ordered_simple_task_runner.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 #ifndef CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 5 #ifndef CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
6 #define CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 6 #define CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
7 7
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // prevent infinite task loops. 66 // prevent infinite task loops.
67 static const size_t kAbsoluteMaxTasks; 67 static const size_t kAbsoluteMaxTasks;
68 void SetRunTaskLimit(size_t max_tasks) { max_tasks_ = max_tasks; } 68 void SetRunTaskLimit(size_t max_tasks) { max_tasks_ = max_tasks; }
69 void ClearRunTaskLimit() { max_tasks_ = kAbsoluteMaxTasks; } 69 void ClearRunTaskLimit() { max_tasks_ = kAbsoluteMaxTasks; }
70 70
71 // Allow task runner to advance now when running tasks. 71 // Allow task runner to advance now when running tasks.
72 void SetAutoAdvanceNowToPendingTasks(bool advance_now) { 72 void SetAutoAdvanceNowToPendingTasks(bool advance_now) {
73 advance_now_ = advance_now; 73 advance_now_ = advance_now;
74 } 74 }
75 75
76 size_t NumPendingTasks() const;
76 bool HasPendingTasks() const; 77 bool HasPendingTasks() const;
77 base::TimeTicks NextTaskTime(); 78 base::TimeTicks NextTaskTime();
78 base::TimeDelta DelayToNextTaskTime(); 79 base::TimeDelta DelayToNextTaskTime();
79 80
80 // Run tasks while the callback returns true or too many tasks have been run. 81 // Run tasks while the callback returns true or too many tasks have been run.
81 // Returns true if there are still pending tasks left. 82 // Returns true if there are still pending tasks left.
82 bool RunTasksWhile(base::Callback<bool(void)> condition); 83 bool RunTasksWhile(base::Callback<bool(void)> condition);
83 84
84 // Run tasks while *all* of the callbacks return true or too many tasks have 85 // Run tasks while *all* of the callbacks return true or too many tasks have
85 // been run. Exits on the *first* condition which returns false, skipping 86 // been run. Exits on the *first* condition which returns false, skipping
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 bool inside_run_tasks_until_; 145 bool inside_run_tasks_until_;
145 std::set<TestOrderablePendingTask> pending_tasks_; 146 std::set<TestOrderablePendingTask> pending_tasks_;
146 147
147 private: 148 private:
148 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner); 149 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner);
149 }; 150 };
150 151
151 } // namespace cc 152 } // namespace cc
152 153
153 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 154 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/ordered_simple_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698