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_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 { | |
| 17 public: | |
| 18 // Called when the main function of the SchedulerWorkerThread is entered. | |
|
robliao
2016/04/06 21:28:20
Nit: 'SchedulerWorkerThread starts.'
'SchedulerWo
fdoray
2016/04/07 13:53:41
Done.
| |
| 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 |