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

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

Issue 2590593002: Revert of [Reland] Scheduler refactoring to virtually eliminate redundant DoWorks (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // Keep running until a task which didn't exist initially would run. 124 // Keep running until a task which didn't exist initially would run.
125 base::Callback<bool(void)> TaskExistedInitially(); 125 base::Callback<bool(void)> TaskExistedInitially();
126 126
127 // Stop running tasks when NextTaskTime() >= stop_at 127 // Stop running tasks when NextTaskTime() >= stop_at
128 base::Callback<bool(void)> NowBefore(base::TimeTicks stop_at); 128 base::Callback<bool(void)> NowBefore(base::TimeTicks stop_at);
129 129
130 // Advance Now() to the next task to run. 130 // Advance Now() to the next task to run.
131 base::Callback<bool(void)> AdvanceNow(); 131 base::Callback<bool(void)> AdvanceNow();
132 132
133 // Removes all tasks whose weak pointer has been revoked.
134 void RemoveCancelledTasks();
135
136 protected: 133 protected:
137 static bool TaskRunCountBelowCallback(size_t max_tasks, size_t* task_run); 134 static bool TaskRunCountBelowCallback(size_t max_tasks, size_t* task_run);
138 bool TaskExistedInitiallyCallback( 135 bool TaskExistedInitiallyCallback(
139 const std::set<TestOrderablePendingTask>& existing_tasks); 136 const std::set<TestOrderablePendingTask>& existing_tasks);
140 bool NowBeforeCallback(base::TimeTicks stop_at); 137 bool NowBeforeCallback(base::TimeTicks stop_at);
141 bool AdvanceNowCallback(); 138 bool AdvanceNowCallback();
142 139
143 ~OrderedSimpleTaskRunner() override; 140 ~OrderedSimpleTaskRunner() override;
144 141
145 base::ThreadChecker thread_checker_; 142 base::ThreadChecker thread_checker_;
146 143
147 bool advance_now_; 144 bool advance_now_;
148 // Not owned. 145 // Not owned.
149 base::SimpleTestTickClock* now_src_; 146 base::SimpleTestTickClock* now_src_;
150 147
151 size_t max_tasks_; 148 size_t max_tasks_;
152 149
153 bool inside_run_tasks_until_; 150 bool inside_run_tasks_until_;
154 std::set<TestOrderablePendingTask> pending_tasks_; 151 std::set<TestOrderablePendingTask> pending_tasks_;
155 152
156 private: 153 private:
157 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner); 154 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner);
158 }; 155 };
159 156
160 } // namespace cc 157 } // namespace cc
161 158
162 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 159 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/test/ordered_simple_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698