OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 BASE_TEST_SCOPED_TASK_ENVIRONMENT_H_ | 5 #ifndef BASE_TEST_SCOPED_TASK_ENVIRONMENT_H_ |
6 #define BASE_TEST_SCOPED_TASK_ENVIRONMENT_H_ | 6 #define BASE_TEST_SCOPED_TASK_ENVIRONMENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 // ScopedTaskEnvironment lives. | 26 // ScopedTaskEnvironment lives. |
27 // | 27 // |
28 // Tasks posted through base/task_scheduler/post_task.h run on dedicated threads | 28 // Tasks posted through base/task_scheduler/post_task.h run on dedicated threads |
29 // as they are posted. | 29 // as they are posted. |
30 // | 30 // |
31 // Design and future improvements documented in | 31 // Design and future improvements documented in |
32 // https://docs.google.com/document/d/1QabRo8c7D9LsYY3cEcaPQbOCLo8Tu-6VLykYXyl3P
kk/edit | 32 // https://docs.google.com/document/d/1QabRo8c7D9LsYY3cEcaPQbOCLo8Tu-6VLykYXyl3P
kk/edit |
33 class ScopedTaskEnvironment { | 33 class ScopedTaskEnvironment { |
34 public: | 34 public: |
35 enum class MainThreadType { | 35 enum class MainThreadType { |
36 // The main thread doesn't pump messages. | 36 // The main thread doesn't pump system messages. |
37 DEFAULT, | 37 DEFAULT, |
38 // The main thread pumps UI messages. | 38 // The main thread pumps UI messages. |
39 UI, | 39 UI, |
40 // The main thread pumps asynchronous IO messages. | 40 // The main thread pumps asynchronous IO messages. |
41 IO, | 41 IO, |
42 }; | 42 }; |
43 | 43 |
44 ScopedTaskEnvironment( | 44 ScopedTaskEnvironment( |
45 MainThreadType main_thread_type = MainThreadType::DEFAULT); | 45 MainThreadType main_thread_type = MainThreadType::DEFAULT); |
46 | 46 |
(...skipping 10 matching lines...) Expand all Loading... |
57 | 57 |
58 const TaskScheduler* task_scheduler_ = nullptr; | 58 const TaskScheduler* task_scheduler_ = nullptr; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(ScopedTaskEnvironment); | 60 DISALLOW_COPY_AND_ASSIGN(ScopedTaskEnvironment); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace test | 63 } // namespace test |
64 } // namespace base | 64 } // namespace base |
65 | 65 |
66 #endif // BASE_TEST_SCOPED_ASYNC_TASK_SCHEDULER_H_ | 66 #endif // BASE_TEST_SCOPED_ASYNC_TASK_SCHEDULER_H_ |
OLD | NEW |