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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 DOMTimer::~DOMTimer() | 90 DOMTimer::~DOMTimer() |
91 { | 91 { |
92 } | 92 } |
93 | 93 |
94 void DOMTimer::disposeTimer() | 94 void DOMTimer::disposeTimer() |
95 { | 95 { |
96 m_action = nullptr; | 96 m_action = nullptr; |
97 m_userGestureToken = nullptr; | 97 m_userGestureToken = nullptr; |
98 stop(); | 98 stop(); |
| 99 clearContext(); |
99 } | 100 } |
100 | 101 |
101 void DOMTimer::fired() | 102 void DOMTimer::fired() |
102 { | 103 { |
103 ExecutionContext* context = getExecutionContext(); | 104 ExecutionContext* context = getExecutionContext(); |
104 ASSERT(context); | 105 ASSERT(context); |
105 context->timers()->setTimerNestingLevel(m_nestingLevel); | 106 context->timers()->setTimerNestingLevel(m_nestingLevel); |
106 ASSERT(!context->activeDOMObjectsAreSuspended()); | 107 ASSERT(!context->activeDOMObjectsAreSuspended()); |
107 // Only the first execution of a multi-shot timer should get an affirmative
user gesture indicator. | 108 // Only the first execution of a multi-shot timer should get an affirmative
user gesture indicator. |
108 UserGestureIndicator gestureIndicator(m_userGestureToken.release()); | 109 UserGestureIndicator gestureIndicator(m_userGestureToken.release()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return getExecutionContext()->timers()->timerTaskRunner(); | 154 return getExecutionContext()->timers()->timerTaskRunner(); |
154 } | 155 } |
155 | 156 |
156 DEFINE_TRACE(DOMTimer) | 157 DEFINE_TRACE(DOMTimer) |
157 { | 158 { |
158 visitor->trace(m_action); | 159 visitor->trace(m_action); |
159 SuspendableTimer::trace(visitor); | 160 SuspendableTimer::trace(visitor); |
160 } | 161 } |
161 | 162 |
162 } // namespace blink | 163 } // namespace blink |
OLD | NEW |