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

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

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 | « base/trace_event/memory_dump_manager_unittest.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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 OrderedSimpleTaskRunner(base::SimpleTestTickClock* now_src, bool advance_now); 63 OrderedSimpleTaskRunner(base::SimpleTestTickClock* now_src, bool advance_now);
64 64
65 // base::TestSimpleTaskRunner implementation: 65 // base::TestSimpleTaskRunner implementation:
66 bool PostDelayedTask(const tracked_objects::Location& from_here, 66 bool PostDelayedTask(const tracked_objects::Location& from_here,
67 base::OnceClosure task, 67 base::OnceClosure task,
68 base::TimeDelta delay) override; 68 base::TimeDelta delay) override;
69 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 69 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
70 base::OnceClosure task, 70 base::OnceClosure task,
71 base::TimeDelta delay) override; 71 base::TimeDelta delay) override;
72 72
73 bool RunsTasksOnCurrentThread() const override; 73 bool RunsTasksInCurrentSequence() const override;
74 74
75 static base::TimeTicks AbsoluteMaxNow(); 75 static base::TimeTicks AbsoluteMaxNow();
76 76
77 // Set a maximum number of tasks to run at once. Useful as a timeout to 77 // Set a maximum number of tasks to run at once. Useful as a timeout to
78 // prevent infinite task loops. 78 // prevent infinite task loops.
79 static const size_t kAbsoluteMaxTasks; 79 static const size_t kAbsoluteMaxTasks;
80 void SetRunTaskLimit(size_t max_tasks) { max_tasks_ = max_tasks; } 80 void SetRunTaskLimit(size_t max_tasks) { max_tasks_ = max_tasks; }
81 void ClearRunTaskLimit() { max_tasks_ = kAbsoluteMaxTasks; } 81 void ClearRunTaskLimit() { max_tasks_ = kAbsoluteMaxTasks; }
82 82
83 // Allow task runner to advance now when running tasks. 83 // Allow task runner to advance now when running tasks.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 bool inside_run_tasks_until_; 160 bool inside_run_tasks_until_;
161 std::set<TestOrderablePendingTask> pending_tasks_; 161 std::set<TestOrderablePendingTask> pending_tasks_;
162 162
163 private: 163 private:
164 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner); 164 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner);
165 }; 165 };
166 166
167 } // namespace cc 167 } // namespace cc
168 168
169 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 169 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | cc/test/ordered_simple_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698