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