~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/platform/SharedTimer.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
namespace WebCore {
30
30
 
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.
33
 
 
 
34
    class SharedTimer {
 
35
    public:
 
36
        virtual ~SharedTimer() {}
 
37
        virtual void setFiredFunction(void (*)()) = 0;
 
38
 
 
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;
 
43
    };
 
44
 
 
45
 
 
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 (*)());
35
 
 
36
 
    // The fire time is relative to the classic POSIX epoch of January 1, 1970,
37
 
    // as the result of currentTime() is.
38
 
 
39
 
    void setSharedTimerFireTime(double fireTime);
 
49
    void setSharedTimerFireTime(double);
40
50
    void stopSharedTimer();
41
51
 
42
 
}
43
 
 
44
 
#endif
 
52
    // Implementation of SharedTimer for the main thread.
 
53
    class MainThreadSharedTimer : public SharedTimer {
 
54
    public:
 
55
        virtual void setFiredFunction(void (*function)())
 
56
        {
 
57
            setSharedTimerFiredFunction(function);
 
58
        }
 
59
        
 
60
        virtual void setFireTime(double fireTime)
 
61
        {
 
62
            setSharedTimerFireTime(fireTime);
 
63
        }
 
64
        
 
65
        virtual void stop()
 
66
        {
 
67
            stopSharedTimer();
 
68
        }
 
69
    };
 
70
 
 
71
} // namespace WebCore
 
72
 
 
73
#endif // SharedTimer_h