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

Unified Diff: base/test/scoped_task_scheduler.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: fixed build error and commments Created 3 years, 8 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
Index: base/test/scoped_task_scheduler.cc
diff --git a/base/test/scoped_task_scheduler.cc b/base/test/scoped_task_scheduler.cc
index 3c5b0e2fc7807a6b14ecddd640109a46c26aa417..550d1b7398b56df2b54a364c3287c5bf27e82e57 100644
--- a/base/test/scoped_task_scheduler.cc
+++ b/base/test/scoped_task_scheduler.cc
@@ -78,7 +78,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
@@ -139,7 +139,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;
@@ -264,8 +264,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(
@@ -300,9 +300,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();
}

Powered by Google App Engine
This is Rietveld 408576698