Add signalSyncPoint to the WebGraphicsContext3D command buffer impls.
[chromium-blink-merge.git] / cc / scheduler / time_source.h
blob140273749f1b7c4beb2918ad9145b2b38d1a2bb6
1 // Copyright 2011 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 CC_SCHEDULER_TIME_SOURCE_H_
6 #define CC_SCHEDULER_TIME_SOURCE_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/time.h"
10 #include "cc/base/cc_export.h"
12 namespace cc {
14 class TimeSourceClient {
15 public:
16 virtual void OnTimerTick() = 0;
18 protected:
19 virtual ~TimeSourceClient() {}
22 // An generic interface for getting a reliably-ticking timesource of
23 // a specified rate.
25 // Be sure to call SetActive(false) before releasing your reference to the
26 // timer, or it will keep on ticking!
27 class CC_EXPORT TimeSource : public base::RefCounted<TimeSource> {
28 public:
29 virtual void SetClient(TimeSourceClient* client) = 0;
30 virtual void SetActive(bool active) = 0;
31 virtual bool Active() const = 0;
32 virtual void SetTimebaseAndInterval(base::TimeTicks timebase,
33 base::TimeDelta interval) = 0;
34 virtual base::TimeTicks LastTickTime() = 0;
35 virtual base::TimeTicks NextTickTime() = 0;
37 protected:
38 virtual ~TimeSource() {}
40 private:
41 friend class base::RefCounted<TimeSource>;
44 } // namespace cc
46 #endif // CC_SCHEDULER_TIME_SOURCE_H_