OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef Timer_h | 26 #ifndef Timer_h |
27 #define Timer_h | 27 #define Timer_h |
28 | 28 |
29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
30 #include "platform/TraceLocation.h" | 30 #include "platform/TraceLocation.h" |
| 31 #include "platform/heap/Handle.h" |
31 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
32 #include "wtf/Threading.h" | 33 #include "wtf/Threading.h" |
33 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
34 | 35 |
35 namespace WebCore { | 36 namespace WebCore { |
36 | 37 |
37 // Time intervals are all in seconds. | 38 // Time intervals are all in seconds. |
38 | 39 |
39 class TimerHeapElement; | 40 class TimerHeapElement; |
40 | 41 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 122 |
122 Timer(TimerFiredClass* o, TimerFiredFunction f) | 123 Timer(TimerFiredClass* o, TimerFiredFunction f) |
123 : m_object(o), m_function(f) { } | 124 : m_object(o), m_function(f) { } |
124 | 125 |
125 private: | 126 private: |
126 virtual void fired() OVERRIDE { (m_object->*m_function)(this); } | 127 virtual void fired() OVERRIDE { (m_object->*m_function)(this); } |
127 | 128 |
128 // FIXME: oilpan: TimerBase should be moved to the heap and m_object should
be traced. | 129 // FIXME: oilpan: TimerBase should be moved to the heap and m_object should
be traced. |
129 // This raw pointer is safe as long as Timer<X> is held by the X itself (Tha
t's the case | 130 // This raw pointer is safe as long as Timer<X> is held by the X itself (Tha
t's the case |
130 // in the current code base). | 131 // in the current code base). |
| 132 GC_PLUGIN_IGNORE("363031") |
131 TimerFiredClass* m_object; | 133 TimerFiredClass* m_object; |
132 TimerFiredFunction m_function; | 134 TimerFiredFunction m_function; |
133 }; | 135 }; |
134 | 136 |
135 inline bool TimerBase::isActive() const | 137 inline bool TimerBase::isActive() const |
136 { | 138 { |
137 ASSERT(m_thread == currentThread()); | 139 ASSERT(m_thread == currentThread()); |
138 return m_nextFireTime; | 140 return m_nextFireTime; |
139 } | 141 } |
140 | 142 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 startOneShot(m_delay, FROM_HERE); | 178 startOneShot(m_delay, FROM_HERE); |
177 return; | 179 return; |
178 } | 180 } |
179 | 181 |
180 (m_object->*m_function)(this); | 182 (m_object->*m_function)(this); |
181 } | 183 } |
182 | 184 |
183 // FIXME: oilpan: TimerBase should be moved to the heap and m_object should
be traced. | 185 // FIXME: oilpan: TimerBase should be moved to the heap and m_object should
be traced. |
184 // This raw pointer is safe as long as Timer<X> is held by the X itself (Tha
t's the case | 186 // This raw pointer is safe as long as Timer<X> is held by the X itself (Tha
t's the case |
185 // in the current code base). | 187 // in the current code base). |
| 188 GC_PLUGIN_IGNORE("363031") |
186 TimerFiredClass* m_object; | 189 TimerFiredClass* m_object; |
187 TimerFiredFunction m_function; | 190 TimerFiredFunction m_function; |
188 | 191 |
189 double m_delay; | 192 double m_delay; |
190 bool m_shouldRestartWhenTimerFires; | 193 bool m_shouldRestartWhenTimerFires; |
191 }; | 194 }; |
192 | 195 |
193 } | 196 } |
194 | 197 |
195 #endif | 198 #endif |
OLD | NEW |