fixup! [M120 Migration] Notify media device state to webbrowser
[platform/framework/web/chromium-efl.git] / components / background_task_scheduler / background_task_scheduler.h
1 // Copyright 2020 The Chromium Authors
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 COMPONENTS_BACKGROUND_TASK_SCHEDULER_BACKGROUND_TASK_SCHEDULER_H_
6 #define COMPONENTS_BACKGROUND_TASK_SCHEDULER_BACKGROUND_TASK_SCHEDULER_H_
7
8 #include "base/functional/callback.h"
9 #include "components/background_task_scheduler/task_info.h"
10 #include "components/keyed_service/core/keyed_service.h"
11
12 namespace background_task {
13
14 // A BackgroundTaskScheduler is used to schedule jobs that run in the
15 // background. It is backed by system APIs which have different implementations
16 // on different android versions. For more information, please refer
17 // BackgroundTaskScheduler.java.
18 class BackgroundTaskScheduler : public KeyedService {
19  public:
20   BackgroundTaskScheduler(const BackgroundTaskScheduler&) = delete;
21   BackgroundTaskScheduler& operator=(const BackgroundTaskScheduler&) = delete;
22
23   // Schedules a background task with various scheduling related params
24   // contained in |task_info|.
25   virtual bool Schedule(const TaskInfo& task_info) = 0;
26
27   // Cancels the task specified by the |task_id}.
28   virtual void Cancel(int task_id) = 0;
29
30  protected:
31   BackgroundTaskScheduler() = default;
32   ~BackgroundTaskScheduler() override = default;
33 };
34
35 }  // namespace background_task
36
37 #endif  // COMPONENTS_BACKGROUND_TASK_SCHEDULER_BACKGROUND_TASK_SCHEDULER_H_