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

Side by Side Diff: base/test/scoped_async_task_scheduler.h

Issue 2867003003: Mark Scoped(Async)TaskScheduler as deprecated. (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 unified diff | Download patch
« no previous file with comments | « no previous file | base/test/scoped_task_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ASYNC_TASK_SCHEDULER_H_ 5 #ifndef BASE_TEST_SCOPED_ASYNC_TASK_SCHEDULER_H_
6 #define BASE_TEST_SCOPED_ASYNC_TASK_SCHEDULER_H_ 6 #define BASE_TEST_SCOPED_ASYNC_TASK_SCHEDULER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 9
10 namespace base { 10 namespace base {
11 11
12 class TaskScheduler; 12 class TaskScheduler;
13 13
14 namespace test { 14 namespace test {
15 15
16 // DEPRECATED. Use ScopedTaskEnvironment instead.
17 //
18 // TODO(fdoray): Replace ScopedAsyncTaskScheduler instances by
19 // ScopedTaskEnvironment. https://crbug.com/708584
20 //
16 // Allows usage of the base/task_scheduler/post_task.h API within its scope. 21 // Allows usage of the base/task_scheduler/post_task.h API within its scope.
17 // 22 //
18 // To wait until all tasks posted without a delay have run, use 23 // To wait until all tasks posted without a delay have run, use
19 // TaskScheduler::GetInstance()->FlushForTesting(). 24 // TaskScheduler::GetInstance()->FlushForTesting().
20 //
21 // Deprecated. Use ScopedTaskEnvironment instead. https://crbug.com/708584
22 //
23 // TODO(fdoray): Replace ScopedAsyncTaskScheduler instances by
24 // ScopedTaskEnvironment.
25 class ScopedAsyncTaskScheduler { 25 class ScopedAsyncTaskScheduler {
26 public: 26 public:
27 // Registers a single-threaded TaskScheduler. 27 // Registers a single-threaded TaskScheduler.
28 ScopedAsyncTaskScheduler(); 28 ScopedAsyncTaskScheduler();
29 29
30 // Shuts down and unregisters the TaskScheduler. 30 // Shuts down and unregisters the TaskScheduler.
31 // 31 //
32 // It is guaranteed that all BLOCK_SHUTDOWN tasks have run when this returns. 32 // It is guaranteed that all BLOCK_SHUTDOWN tasks have run when this returns.
33 ~ScopedAsyncTaskScheduler(); 33 ~ScopedAsyncTaskScheduler();
34 34
35 private: 35 private:
36 const TaskScheduler* task_scheduler_ = nullptr; 36 const TaskScheduler* task_scheduler_ = nullptr;
37 37
38 DISALLOW_COPY_AND_ASSIGN(ScopedAsyncTaskScheduler); 38 DISALLOW_COPY_AND_ASSIGN(ScopedAsyncTaskScheduler);
39 }; 39 };
40 40
41 } // namespace test 41 } // namespace test
42 } // namespace base 42 } // namespace base
43 43
44 #endif // BASE_TEST_SCOPED_ASYNC_TASK_SCHEDULER_H_ 44 #endif // BASE_TEST_SCOPED_ASYNC_TASK_SCHEDULER_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/scoped_task_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698