| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" | 6 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" |
| 7 | 7 |
| 8 #include "core/dom/Microtask.h" | 8 #include "core/dom/Microtask.h" |
| 9 #include "core/dom/custom/CustomElementCallbackDispatcher.h" | 9 #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
| 10 #include "core/dom/custom/CustomElementCallbackQueue.h" | 10 #include "core/dom/custom/CustomElementCallbackQueue.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 void CustomElementMicrotaskDispatcher::importDidFinish(CustomElementMicrotaskImp
ortStep* step) | 50 void CustomElementMicrotaskDispatcher::importDidFinish(CustomElementMicrotaskImp
ortStep* step) |
| 51 { | 51 { |
| 52 ASSERT(m_phase == Quiescent || m_phase == DispatchingCallbacks); | 52 ASSERT(m_phase == Quiescent || m_phase == DispatchingCallbacks); |
| 53 ensureMicrotaskScheduled(); | 53 ensureMicrotaskScheduled(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void CustomElementMicrotaskDispatcher::ensureMicrotaskScheduled() | 56 void CustomElementMicrotaskDispatcher::ensureMicrotaskScheduled() |
| 57 { | 57 { |
| 58 if (!m_hasScheduledMicrotask) { | 58 if (!m_hasScheduledMicrotask) { |
| 59 Microtask::enqueueMicrotask(&dispatch); | 59 Microtask::enqueueMicrotask(WTF::bind(&dispatch)); |
| 60 m_hasScheduledMicrotask = true; | 60 m_hasScheduledMicrotask = true; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 void CustomElementMicrotaskDispatcher::dispatch() | 64 void CustomElementMicrotaskDispatcher::dispatch() |
| 65 { | 65 { |
| 66 instance().doDispatch(); | 66 instance().doDispatch(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void CustomElementMicrotaskDispatcher::doDispatch() | 69 void CustomElementMicrotaskDispatcher::doDispatch() |
| (...skipping 17 matching lines...) Expand all Loading... |
| 87 CustomElementCallbackDispatcher::CallbackDeliveryScope scope; | 87 CustomElementCallbackDispatcher::CallbackDeliveryScope scope; |
| 88 (*it)->processInElementQueue(kMicrotaskQueueId); | 88 (*it)->processInElementQueue(kMicrotaskQueueId); |
| 89 } | 89 } |
| 90 | 90 |
| 91 m_elements.clear(); | 91 m_elements.clear(); |
| 92 CustomElementScheduler::microtaskDispatcherDidFinish(); | 92 CustomElementScheduler::microtaskDispatcherDidFinish(); |
| 93 m_phase = Quiescent; | 93 m_phase = Quiescent; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace WebCore | 96 } // namespace WebCore |
| OLD | NEW |