blob: ccd6ba8c5c3cd8739ff51a05ab576607ed02f70c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#ifndef HeapTimer_h
#define HeapTimer_h
#include <wtf/RetainPtr.h>
#if USE(CF)
#include <CoreFoundation/CoreFoundation.h>
#endif
namespace JSC {
class JSGlobalData;
class HeapTimer {
public:
#if USE(CF)
HeapTimer(JSGlobalData*, CFRunLoopRef);
static void timerDidFire(CFRunLoopTimerRef, void*);
#else
HeapTimer(JSGlobalData*);
#endif
virtual ~HeapTimer();
virtual void synchronize();
virtual void doWork() = 0;
protected:
JSGlobalData* m_globalData;
#if USE(CF)
static const CFTimeInterval s_decade;
RetainPtr<CFRunLoopTimerRef> m_timer;
RetainPtr<CFRunLoopRef> m_runLoop;
CFRunLoopTimerContext m_context;
#endif
private:
void invalidate();
};
} // namespace JSC
#endif
|