[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / component_updater / timer.h
1 // Copyright 2015 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_COMPONENT_UPDATER_TIMER_H_
6 #define COMPONENTS_COMPONENT_UPDATER_TIMER_H_
7
8 #include "base/functional/callback.h"
9 #include "base/sequence_checker.h"
10 #include "base/time/time.h"
11 #include "base/timer/timer.h"
12
13 namespace component_updater {
14
15 class Timer {
16  public:
17   Timer();
18
19   Timer(const Timer&) = delete;
20   Timer& operator=(const Timer&) = delete;
21
22   ~Timer();
23
24   void Start(base::TimeDelta initial_delay,
25              base::TimeDelta delay,
26              const base::RepeatingClosure& user_task);
27
28   void Stop();
29
30  private:
31   void OnDelay();
32
33   SEQUENCE_CHECKER(sequence_checker_);
34
35   base::OneShotTimer timer_;
36
37   base::TimeDelta delay_;
38   base::RepeatingClosure user_task_;
39 };
40
41 }  // namespace component_updater
42
43 #endif  // COMPONENTS_COMPONENT_UPDATER_TIMER_H_