[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / component_updater / timer_update_scheduler.cc
1 // Copyright 2018 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 #include "components/component_updater/timer_update_scheduler.h"
6 #include "base/functional/bind.h"
7 #include "base/functional/callback_helpers.h"
8
9 namespace component_updater {
10
11 TimerUpdateScheduler::TimerUpdateScheduler() = default;
12 TimerUpdateScheduler::~TimerUpdateScheduler() = default;
13
14 void TimerUpdateScheduler::Schedule(const base::TimeDelta& initial_delay,
15                                     const base::TimeDelta& delay,
16                                     const UserTask& user_task,
17                                     const OnStopTaskCallback& on_stop) {
18   timer_.Start(
19       initial_delay, delay,
20       base::BindRepeating(
21           [](const UserTask& user_task) { user_task.Run(base::DoNothing()); },
22           user_task));
23 }
24
25 void TimerUpdateScheduler::Stop() {
26   timer_.Stop();
27 }
28
29 }  // namespace component_updater