OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_TASK_SCHEDULER_SCHEDULER_TASK_EXECUTOR_H_ | 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_INTERFACE_H_ |
6 #define BASE_TASK_SCHEDULER_SCHEDULER_TASK_EXECUTOR_H_ | 6 #define BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_INTERFACE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/task_scheduler/sequence.h" | 12 #include "base/task_scheduler/sequence.h" |
13 #include "base/task_scheduler/task.h" | 13 #include "base/task_scheduler/task.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 // Interface for a component that runs Tasks. | 18 // Interface for a thread pool. |
gab
2016/04/22 18:53:56
s/Interface/Minimal post task interface/ ?
fdoray
2016/04/22 22:18:14
Done. s/Interface/Minimal interface/. It's not jus
| |
19 class BASE_EXPORT SchedulerTaskExecutor { | 19 class BASE_EXPORT SchedulerThreadPoolInterface { |
robliao
2016/04/22 20:22:25
It's not common to have a class with Interface as
fdoray
2016/04/22 22:18:14
Renamed SchedulerThreadPoolInterface -> SchedulerT
| |
20 public: | 20 public: |
21 virtual ~SchedulerTaskExecutor() = default; | 21 virtual ~SchedulerThreadPoolInterface() = default; |
22 | 22 |
23 // Posts |task| to be executed by this component as part of |sequence|. The | 23 // Posts |task| to be executed by this thread pool as part of |sequence|. The |
24 // scheduler's TaskTracker must have allowed |task| to be posted before this | 24 // scheduler's TaskTracker must have allowed |task| to be posted before this |
25 // is called. This must only be called after |task|'s delayed run time. | 25 // is called. This must only be called after |task|'s delayed run time. |
26 virtual void PostTaskWithSequence(std::unique_ptr<Task> task, | 26 virtual void PostTaskWithSequenceNow(std::unique_ptr<Task> task, |
27 scoped_refptr<Sequence> sequence) = 0; | 27 scoped_refptr<Sequence> sequence) = 0; |
28 }; | 28 }; |
29 | 29 |
30 } // namespace internal | 30 } // namespace internal |
31 } // namespace base | 31 } // namespace base |
32 | 32 |
33 #endif // BASE_TASK_SCHEDULER_SCHEDULER_TASK_EXECUTOR_H_ | 33 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_INTERFACE_H_ |
OLD | NEW |