29
29
namespace WebCore {
31
// Single timer, shared to implement all the timers managed by the Timer class.
31
// Each thread has its own single instance of shared timer, which implements this interface.
32
// This instance is shared by all timers in the thread.
32
33
// Not intended to be used directly; use the Timer class instead.
36
virtual ~SharedTimer() {}
37
virtual void setFiredFunction(void (*)()) = 0;
39
// The fire time is relative to the classic POSIX epoch of January 1, 1970,
40
// as the result of currentTime() is.
41
virtual void setFireTime(double) = 0;
42
virtual void stop() = 0;
46
// Implemented by port (since it provides the run loop for the main thread).
47
// FIXME: make ports implement MainThreadSharedTimer directly instead.
34
48
void setSharedTimerFiredFunction(void (*)());
36
// The fire time is relative to the classic POSIX epoch of January 1, 1970,
37
// as the result of currentTime() is.
39
void setSharedTimerFireTime(double fireTime);
49
void setSharedTimerFireTime(double);
40
50
void stopSharedTimer();
52
// Implementation of SharedTimer for the main thread.
53
class MainThreadSharedTimer : public SharedTimer {
55
virtual void setFiredFunction(void (*function)())
57
setSharedTimerFiredFunction(function);
60
virtual void setFireTime(double fireTime)
62
setSharedTimerFireTime(fireTime);
71
} // namespace WebCore
73
#endif // SharedTimer_h