Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_TEST_SCOPED_TASK_SCHEDULER_H_ | |
| 6 #define BASE_TEST_SCOPED_TASK_SCHEDULER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 | |
| 10 namespace base { | |
| 11 namespace test { | |
| 12 | |
| 13 // Initializes a TaskScheduler and allows usage of the | |
| 14 // base/task_scheduler/post_task.h API within a scope. | |
|
gab
2016/11/16 21:29:19
s/a/its/
fdoray
2016/11/16 22:04:45
Done.
| |
| 15 class ScopedTaskScheduler { | |
| 16 public: | |
| 17 // Initializes a TaskScheduler with default arguments. | |
| 18 ScopedTaskScheduler(); | |
| 19 | |
| 20 // Waits until all TaskScheduler tasks blocking shutdown complete their | |
| 21 // execution (see TaskShutdownBehavior). Then, joins all TaskScheduler threads | |
| 22 // and deletes the TaskScheduler. | |
| 23 // | |
| 24 // Note that joining TaskScheduler threads may involve waiting for | |
| 25 // CONTINUE_ON_SHUTDOWN tasks to complete their execution. Normally, in | |
| 26 // production, the process exits without joining TaskScheduler threads. | |
| 27 ~ScopedTaskScheduler(); | |
| 28 | |
| 29 private: | |
| 30 DISALLOW_COPY_AND_ASSIGN(ScopedTaskScheduler); | |
| 31 }; | |
| 32 | |
| 33 } // namespace test | |
| 34 } // namespace base | |
| 35 | |
| 36 #endif // BASE_TEST_SCOPED_TASK_SCHEDULER_H_ | |
| OLD | NEW |