| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 141 UserGestureIndicator gestureIndicator(std::move(m_userGestureToken)); | 141 UserGestureIndicator gestureIndicator(std::move(m_userGestureToken)); |
| 142 | 142 |
| 143 TRACE_EVENT1("devtools.timeline", "TimerFire", "data", | 143 TRACE_EVENT1("devtools.timeline", "TimerFire", "data", |
| 144 InspectorTimerFireEvent::data(context, m_timeoutID)); | 144 InspectorTimerFireEvent::data(context, m_timeoutID)); |
| 145 probe::UserCallback probe(context, | 145 probe::UserCallback probe(context, |
| 146 repeatInterval() ? "setInterval" : "setTimeout", | 146 repeatInterval() ? "setInterval" : "setTimeout", |
| 147 AtomicString(), true); | 147 AtomicString(), true); |
| 148 probe::AsyncTask asyncTask(context, this, "timerFired"); | 148 probe::AsyncTask asyncTask(context, this); |
| 149 | 149 |
| 150 // Simple case for non-one-shot timers. | 150 // Simple case for non-one-shot timers. |
| 151 if (isActive()) { | 151 if (isActive()) { |
| 152 if (repeatInterval() && repeatInterval() < minimumInterval) { | 152 if (repeatInterval() && repeatInterval() < minimumInterval) { |
| 153 m_nestingLevel++; | 153 m_nestingLevel++; |
| 154 if (m_nestingLevel >= maxTimerNestingLevel) | 154 if (m_nestingLevel >= maxTimerNestingLevel) |
| 155 augmentRepeatInterval(minimumInterval - repeatInterval()); | 155 augmentRepeatInterval(minimumInterval - repeatInterval()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // No access to member variables after this point, it can delete the timer. | 158 // No access to member variables after this point, it can delete the timer. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 189 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { | 189 RefPtr<WebTaskRunner> DOMTimer::timerTaskRunner() const { |
| 190 return getExecutionContext()->timers()->timerTaskRunner(); | 190 return getExecutionContext()->timers()->timerTaskRunner(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 DEFINE_TRACE(DOMTimer) { | 193 DEFINE_TRACE(DOMTimer) { |
| 194 visitor->trace(m_action); | 194 visitor->trace(m_action); |
| 195 SuspendableTimer::trace(visitor); | 195 SuspendableTimer::trace(visitor); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace blink | 198 } // namespace blink |
| OLD | NEW |