Test upload from mkearney.
[chromium-blink-merge.git] / cc / CCTimeSource.h
blobe74c50858a604799dfe66d2aee1e75332de57ea6
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 CCTimeSource_h
6 #define CCTimeSource_h
8 #include <wtf/RefCounted.h>
10 namespace WebCore {
12 class CCThread;
14 class CCTimeSourceClient {
15 public:
16 virtual void onTimerTick() = 0;
18 protected:
19 virtual ~CCTimeSourceClient() { }
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 CCTimeSource : public RefCounted<CCTimeSource> {
28 public:
29 virtual ~CCTimeSource() { }
30 virtual void setClient(CCTimeSourceClient*) = 0;
31 virtual void setActive(bool) = 0;
32 virtual bool active() const = 0;
33 virtual void setTimebaseAndInterval(double timebase, double intervalSeconds) = 0;
34 virtual double lastTickTime() = 0;
35 virtual double nextTickTimeIfActivated() = 0;
39 #endif // CCSmoothedTimer_h