1 // Copyright 2018 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_OBSERVER_H_
6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_OBSERVER_H_
7 
8 namespace base {
9 
10 // Interface to observe entry and exit of the main function of a TaskScheduler
11 // worker.
12 class SchedulerWorkerObserver {
13  public:
14   virtual ~SchedulerWorkerObserver() = default;
15 
16   // Invoked at the beginning of the main function of a TaskScheduler worker,
17   // before any task runs.
18   virtual void OnSchedulerWorkerMainEntry() = 0;
19 
20   // Invoked at the end of the main function of a TaskScheduler worker, when it
21   // can no longer run tasks.
22   virtual void OnSchedulerWorkerMainExit() = 0;
23 };
24 
25 }  // namespace base
26 
27 #endif  // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_OBSERVER_H_
28