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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return; | 163 return; |
164 } | 164 } |
165 | 165 |
166 // Unregister the timer from ExecutionContext before executing the action | 166 // Unregister the timer from ExecutionContext before executing the action |
167 // for one-shot timers. | 167 // for one-shot timers. |
168 ScheduledAction* action = m_action.release(); | 168 ScheduledAction* action = m_action.release(); |
169 context->timers()->removeTimeoutByID(m_timeoutID); | 169 context->timers()->removeTimeoutByID(m_timeoutID); |
170 | 170 |
171 action->execute(context); | 171 action->execute(context); |
172 | 172 |
173 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), | |
174 "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", | |
175 InspectorUpdateCountersEvent::data()); | |
176 | |
177 // ExecutionContext might be already gone when we executed action->execute(). | 173 // ExecutionContext might be already gone when we executed action->execute(). |
178 ExecutionContext* executionContext = getExecutionContext(); | 174 ExecutionContext* executionContext = getExecutionContext(); |
179 if (!executionContext) | 175 if (!executionContext) |
180 return; | 176 return; |
181 | 177 |
182 executionContext->timers()->setTimerNestingLevel(0); | 178 executionContext->timers()->setTimerNestingLevel(0); |
183 // Eagerly unregister as ExecutionContext observer. | 179 // Eagerly unregister as ExecutionContext observer. |
184 clearContext(); | 180 clearContext(); |
185 // Eagerly clear out |action|'s resources. | 181 // Eagerly clear out |action|'s resources. |
186 action->dispose(); | 182 action->dispose(); |
187 } | 183 } |
188 | 184 |
189 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { | 185 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { |
190 return getExecutionContext()->timers()->timerTaskRunner(); | 186 return getExecutionContext()->timers()->timerTaskRunner(); |
191 } | 187 } |
192 | 188 |
193 DEFINE_TRACE(DOMTimer) { | 189 DEFINE_TRACE(DOMTimer) { |
194 visitor->trace(m_action); | 190 visitor->trace(m_action); |
195 SuspendableTimer::trace(visitor); | 191 SuspendableTimer::trace(visitor); |
196 } | 192 } |
197 | 193 |
198 } // namespace blink | 194 } // namespace blink |
OLD | NEW |