| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 action_ = nullptr; | 126 action_ = nullptr; |
| 127 SuspendableTimer::Stop(); | 127 SuspendableTimer::Stop(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DOMTimer::ContextDestroyed(ExecutionContext*) { | 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 DCHECK(context); |
| 137 context->Timers()->SetTimerNestingLevel(nesting_level_); | 137 context->Timers()->SetTimerNestingLevel(nesting_level_); |
| 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 gesture_indicator(std::move(user_gesture_token_)); | 141 UserGestureIndicator gesture_indicator(std::move(user_gesture_token_)); |
| 142 | 142 |
| 143 TRACE_EVENT1("devtools.timeline", "TimerFire", "data", | 143 TRACE_EVENT1("devtools.timeline", "TimerFire", "data", |
| 144 InspectorTimerFireEvent::Data(context, timeout_id_)); | 144 InspectorTimerFireEvent::Data(context, timeout_id_)); |
| 145 probe::UserCallback probe(context, | 145 probe::UserCallback probe(context, |
| 146 RepeatInterval() ? "setInterval" : "setTimeout", | 146 RepeatInterval() ? "setInterval" : "setTimeout", |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 RefPtr<WebTaskRunner> DOMTimer::TimerTaskRunner() const { | 186 RefPtr<WebTaskRunner> DOMTimer::TimerTaskRunner() const { |
| 187 return GetExecutionContext()->Timers()->TimerTaskRunner(); | 187 return GetExecutionContext()->Timers()->TimerTaskRunner(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 DEFINE_TRACE(DOMTimer) { | 190 DEFINE_TRACE(DOMTimer) { |
| 191 visitor->Trace(action_); | 191 visitor->Trace(action_); |
| 192 SuspendableTimer::Trace(visitor); | 192 SuspendableTimer::Trace(visitor); |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace blink | 195 } // namespace blink |
| OLD | NEW |