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_TASK_SCHEDULER_SCHEDULER_WORKER_THREAD_DELEGATE_H_ | |
6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_THREAD_DELEGATE_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 #include "base/task_scheduler/sequence.h" | |
10 | |
11 namespace base { | |
12 namespace internal { | |
13 | |
14 // Delegate interface for SchedulerWorkerThread. The methods are always called | |
15 // from the thread managed by the SchedulerWorkerThread instance. | |
16 class SchedulerWorkerThreadDelegate { | |
gab
2016/04/07 16:42:08
I think it's better to define this on SchedulerWor
fdoray
2016/04/07 17:59:32
Done.
| |
17 public: | |
gab
2016/04/07 16:42:08
I think you need to explicitly make the destructor
fdoray
2016/04/07 17:59:32
Done.
| |
18 // Called when the main function of the SchedulerWorkerThread enters. | |
19 virtual void OnMainEntry() = 0; | |
20 | |
21 // Called when the main function of the SchedulerWorkerThread exits. | |
22 virtual void OnMainExit() = 0; | |
23 | |
24 // Called by the SchedulerWorkerThread to get a Sequence from which to run a | |
25 // Task. | |
26 virtual scoped_refptr<Sequence> GetWork() = 0; | |
27 | |
28 // Called after the SchedulerWorkerThread has tried to run a Task from | |
29 // |sequence| (a TaskTracker might have prevented the Task from running). | |
30 virtual void RanTaskFromSequence(scoped_refptr<Sequence> sequence) = 0; | |
31 }; | |
32 | |
33 } // namespace internal | |
34 } // namespace base | |
35 | |
36 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_THREAD_DELEGATE_H_ | |
OLD | NEW |