| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // Simple case for non-one-shot timers. | 152 // Simple case for non-one-shot timers. |
| 153 if (isActive()) { | 153 if (isActive()) { |
| 154 if (repeatInterval() && repeatInterval() < minimumInterval) { | 154 if (repeatInterval() && repeatInterval() < minimumInterval) { |
| 155 m_nestingLevel++; | 155 m_nestingLevel++; |
| 156 if (m_nestingLevel >= maxTimerNestingLevel) | 156 if (m_nestingLevel >= maxTimerNestingLevel) |
| 157 augmentRepeatInterval(minimumInterval - repeatInterval()); | 157 augmentRepeatInterval(minimumInterval - repeatInterval()); |
| 158 } | 158 } |
| 159 | 159 |
| 160 // No access to member variables after this point, it can delete the timer. | 160 // No access to member variables after this point, it can delete the timer. |
| 161 m_action->execute(context); | 161 m_action->execute(context); |
| 162 |
| 163 context->timers()->setTimerNestingLevel(0); |
| 164 |
| 162 return; | 165 return; |
| 163 } | 166 } |
| 164 | 167 |
| 165 // Unregister the timer from ExecutionContext before executing the action | 168 // Unregister the timer from ExecutionContext before executing the action |
| 166 // for one-shot timers. | 169 // for one-shot timers. |
| 167 ScheduledAction* action = m_action.release(); | 170 ScheduledAction* action = m_action.release(); |
| 168 context->timers()->removeTimeoutByID(m_timeoutID); | 171 context->timers()->removeTimeoutByID(m_timeoutID); |
| 169 | 172 |
| 170 action->execute(context); | 173 action->execute(context); |
| 171 | 174 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 188 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { | 191 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { |
| 189 return getExecutionContext()->timers()->timerTaskRunner(); | 192 return getExecutionContext()->timers()->timerTaskRunner(); |
| 190 } | 193 } |
| 191 | 194 |
| 192 DEFINE_TRACE(DOMTimer) { | 195 DEFINE_TRACE(DOMTimer) { |
| 193 visitor->trace(m_action); | 196 visitor->trace(m_action); |
| 194 SuspendableTimer::trace(visitor); | 197 SuspendableTimer::trace(visitor); |
| 195 } | 198 } |
| 196 | 199 |
| 197 } // namespace blink | 200 } // namespace blink |
| OLD | NEW |