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

Unified Diff: base/test/scoped_task_environment.h

Issue 2903633003: Revert of Add ScopedTaskEnvironment::ExecutionControlMode. (Closed)
Patch Set: 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/task_scheduler/task_tracker_posix.h ('k') | base/test/scoped_task_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/scoped_task_environment.h
diff --git a/base/test/scoped_task_environment.h b/base/test/scoped_task_environment.h
index 6156c21537cab850680119852432b1232ec3009d..f46b516d7c16ddea6d7a6b710fd9a7832045dc29 100644
--- a/base/test/scoped_task_environment.h
+++ b/base/test/scoped_task_environment.h
@@ -26,9 +26,7 @@
// RunLoop::Run(UntilIdle) or ScopedTaskEnvironment::RunUntilIdle is called on
// the thread where the ScopedTaskEnvironment lives.
//
-// Tasks posted through base/task_scheduler/post_task.h run on dedicated
-// threads. If ExecutionControlMode is QUEUED, they run when RunUntilIdle() or
-// ~ScopedTaskEnvironment is called. If ExecutionControlMode is ASYNC, they run
+// Tasks posted through base/task_scheduler/post_task.h run on dedicated threads
// as they are posted.
//
// All methods of ScopedTaskEnvironment must be called from the same thread.
@@ -63,17 +61,8 @@
IO,
};
- enum class ExecutionControlMode {
- // Tasks are queued and executed when RunUntilIdle() is called.
- QUEUED,
- // Tasks run as they are posted.
- ASYNC,
- };
-
ScopedTaskEnvironment(
- MainThreadType main_thread_type = MainThreadType::DEFAULT,
- ExecutionControlMode execution_control_mode =
- ExecutionControlMode::ASYNC);
+ MainThreadType main_thread_type = MainThreadType::DEFAULT);
// Waits until no undelayed TaskScheduler tasks remain. Then, unregisters the
// TaskScheduler and the (Thread|Sequenced)TaskRunnerHandle.
@@ -82,24 +71,17 @@
// Returns a TaskRunner that schedules tasks on the main thread.
scoped_refptr<base::SingleThreadTaskRunner> GetMainThreadTaskRunner();
- // Runs tasks until both the (Thread|Sequenced)TaskRunnerHandle and the
- // TaskScheduler queues are empty.
+ // Synchronously runs (Thread|Sequenced)TaskRunnerHandle tasks until no
+ // undelayed (Thread|Sequenced)TaskRunnerHandle or TaskScheduler tasks remain.
void RunUntilIdle();
private:
- class TestTaskTracker;
-
- const ExecutionControlMode execution_control_mode_;
-
// Note: |message_loop_| is an implementation detail and will be replaced in
// the future, do NOT rely on the presence of a MessageLoop beyond
// (Thread|Sequenced)TaskRunnerHandle and RunLoop.
MessageLoop message_loop_;
const TaskScheduler* task_scheduler_ = nullptr;
-
- // Owned by |task_scheduler_|.
- TestTaskTracker* const task_tracker_;
DISALLOW_COPY_AND_ASSIGN(ScopedTaskEnvironment);
};
« no previous file with comments | « base/task_scheduler/task_tracker_posix.h ('k') | base/test/scoped_task_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698