OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 if (singleShot) | 101 if (singleShot) |
102 startOneShot(intervalMilliseconds, FROM_HERE); | 102 startOneShot(intervalMilliseconds, FROM_HERE); |
103 else | 103 else |
104 startRepeating(intervalMilliseconds, FROM_HERE); | 104 startRepeating(intervalMilliseconds, FROM_HERE); |
105 } | 105 } |
106 | 106 |
107 DOMTimer::~DOMTimer() | 107 DOMTimer::~DOMTimer() |
108 { | 108 { |
109 } | 109 } |
110 | 110 |
| 111 void DOMTimer::dispose() |
| 112 { |
| 113 m_action = nullptr; |
| 114 m_userGestureToken = nullptr; |
| 115 stop(); |
| 116 } |
| 117 |
111 int DOMTimer::timeoutID() const | 118 int DOMTimer::timeoutID() const |
112 { | 119 { |
113 return m_timeoutID; | 120 return m_timeoutID; |
114 } | 121 } |
115 | 122 |
116 void DOMTimer::fired() | 123 void DOMTimer::fired() |
117 { | 124 { |
118 ExecutionContext* context = executionContext(); | 125 ExecutionContext* context = executionContext(); |
119 context->setTimerNestingLevel(m_nestingLevel); | 126 context->setTimerNestingLevel(m_nestingLevel); |
120 ASSERT(!context->activeDOMObjectsAreSuspended()); | 127 ASSERT(!context->activeDOMObjectsAreSuspended()); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 if (fireTime - alignedTimeRoundedDown < minimumInterval) | 213 if (fireTime - alignedTimeRoundedDown < minimumInterval) |
207 return alignedTimeRoundedDown; | 214 return alignedTimeRoundedDown; |
208 | 215 |
209 return alignedTimeRoundedUp; | 216 return alignedTimeRoundedUp; |
210 } | 217 } |
211 | 218 |
212 return fireTime; | 219 return fireTime; |
213 } | 220 } |
214 | 221 |
215 } // namespace blink | 222 } // namespace blink |
OLD | NEW |