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

Unified Diff: base/test/scoped_task_scheduler.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/null_task_runner.cc ('k') | base/test/test_mock_time_task_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/scoped_task_scheduler.cc
diff --git a/base/test/scoped_task_scheduler.cc b/base/test/scoped_task_scheduler.cc
index ba19f628f3f882f1bfb74850c4d6a39c585ccc1c..0b9a1987fc4a896e48bd4e90b626cb7b5e537594 100644
--- a/base/test/scoped_task_scheduler.cc
+++ b/base/test/scoped_task_scheduler.cc
@@ -82,7 +82,7 @@ class TestTaskScheduler : public TaskScheduler {
const SequenceToken& sequence_token);
// Returns true if this TaskScheduler runs its tasks on the current thread.
- bool RunsTasksOnCurrentThread() const;
+ bool RunsTasksInCurrentSequence() const;
private:
// Returns the TaskRunner to which this TaskScheduler forwards tasks. It may
@@ -143,7 +143,7 @@ class TestTaskSchedulerTaskRunner : public SingleThreadTaskRunner {
bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
OnceClosure closure,
TimeDelta delay) override;
- bool RunsTasksOnCurrentThread() const override;
+ bool RunsTasksInCurrentSequence() const override;
private:
~TestTaskSchedulerTaskRunner() override;
@@ -272,8 +272,8 @@ void TestTaskScheduler::RunTask(std::unique_ptr<internal::Task> task,
saved_task_runner_ = nullptr;
}
-bool TestTaskScheduler::RunsTasksOnCurrentThread() const {
- return MessageLoopTaskRunner()->RunsTasksOnCurrentThread();
+bool TestTaskScheduler::RunsTasksInCurrentSequence() const {
+ return MessageLoopTaskRunner()->RunsTasksInCurrentSequence();
}
TestTaskSchedulerTaskRunner::TestTaskSchedulerTaskRunner(
@@ -308,9 +308,9 @@ bool TestTaskSchedulerTaskRunner::PostNonNestableDelayedTask(
return PostDelayedTask(from_here, std::move(closure), delay);
}
-bool TestTaskSchedulerTaskRunner::RunsTasksOnCurrentThread() const {
+bool TestTaskSchedulerTaskRunner::RunsTasksInCurrentSequence() const {
if (execution_mode_ == ExecutionMode::PARALLEL)
- return task_scheduler_->RunsTasksOnCurrentThread();
+ return task_scheduler_->RunsTasksInCurrentSequence();
return sequence_token_ == SequenceToken::GetForCurrentThread();
}
« no previous file with comments | « base/test/null_task_runner.cc ('k') | base/test/test_mock_time_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698