Roll src/third_party/WebKit 9f7fb92:f103b33 (svn 202621:202622)
[chromium-blink-merge.git] / components / component_updater / timer.h
blob8b728996a96cf62f5c26bd9ee38ef0377b3890b4
1 // Copyright 2015 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.
5 #ifndef COMPONENTS_COMPONENT_UPDATER_TIMER_H_
6 #define COMPONENTS_COMPONENT_UPDATER_TIMER_H_
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/threading/thread_checker.h"
11 #include "base/time/time.h"
12 #include "base/timer/timer.h"
14 namespace component_updater {
16 class Timer {
17 public:
18 Timer();
19 ~Timer();
21 void Start(base::TimeDelta initial_delay,
22 base::TimeDelta delay,
23 const base::Closure& user_task);
25 void Stop();
27 private:
28 void OnDelay();
30 base::ThreadChecker thread_checker_;
32 base::Timer timer_;
34 base::TimeDelta delay_;
35 base::Closure user_task_;
37 DISALLOW_COPY_AND_ASSIGN(Timer);
40 } // namespace component_updater
42 #endif // COMPONENTS_COMPONENT_UPDATER_TIMER_H_