| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 m_userGestureToken = nullptr; | 120 m_userGestureToken = nullptr; |
| 121 // Need to release JS objects potentially protected by ScheduledAction | 121 // Need to release JS objects potentially protected by ScheduledAction |
| 122 // because they can form circular references back to the ExecutionContext | 122 // because they can form circular references back to the ExecutionContext |
| 123 // which will cause a memory leak. | 123 // which will cause a memory leak. |
| 124 if (m_action) | 124 if (m_action) |
| 125 m_action->dispose(); | 125 m_action->dispose(); |
| 126 m_action = nullptr; | 126 m_action = nullptr; |
| 127 SuspendableTimer::stop(); | 127 SuspendableTimer::stop(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DOMTimer::contextDestroyed() { | 130 void DOMTimer::contextDestroyed(ExecutionContext*) { |
| 131 stop(); | 131 stop(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void DOMTimer::fired() { | 134 void DOMTimer::fired() { |
| 135 ExecutionContext* context = getExecutionContext(); | 135 ExecutionContext* context = getExecutionContext(); |
| 136 ASSERT(context); | 136 ASSERT(context); |
| 137 context->timers()->setTimerNestingLevel(m_nestingLevel); | 137 context->timers()->setTimerNestingLevel(m_nestingLevel); |
| 138 DCHECK(!context->isContextSuspended()); | 138 DCHECK(!context->isContextSuspended()); |
| 139 // Only the first execution of a multi-shot timer should get an affirmative | 139 // Only the first execution of a multi-shot timer should get an affirmative |
| 140 // user gesture indicator. | 140 // user gesture indicator. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { | 187 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { |
| 188 return getExecutionContext()->timers()->timerTaskRunner(); | 188 return getExecutionContext()->timers()->timerTaskRunner(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 DEFINE_TRACE(DOMTimer) { | 191 DEFINE_TRACE(DOMTimer) { |
| 192 visitor->trace(m_action); | 192 visitor->trace(m_action); |
| 193 SuspendableTimer::trace(visitor); | 193 SuspendableTimer::trace(visitor); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |