| 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 "core/dom/custom/CustomElementMicrotaskDispatcher.h" | 5 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Microtask.h" | 7 #include "bindings/core/v8/Microtask.h" |
| 8 #include "core/dom/custom/CustomElementCallbackQueue.h" | 8 #include "core/dom/custom/CustomElementCallbackQueue.h" |
| 9 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" | 9 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" |
| 10 #include "core/dom/custom/CustomElementProcessingStack.h" | 10 #include "core/dom/custom/CustomElementProcessingStack.h" |
| 11 #include "core/dom/custom/CustomElementScheduler.h" | 11 #include "core/dom/custom/CustomElementScheduler.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 static const CustomElementCallbackQueue::ElementQueueId kMicrotaskQueueId = 0; | 15 static const CustomElementCallbackQueue::ElementQueueId kMicrotaskQueueId = 0; |
| 16 | 16 |
| 17 CustomElementMicrotaskDispatcher::CustomElementMicrotaskDispatcher() | 17 CustomElementMicrotaskDispatcher::CustomElementMicrotaskDispatcher() |
| 18 : m_hasScheduledMicrotask(false) | 18 : m_hasScheduledMicrotask(false) |
| 19 , m_phase(Quiescent) | 19 , m_phase(Quiescent) |
| 20 { | 20 { |
| 21 } | 21 } |
| 22 | 22 |
| 23 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CustomElementMicrotaskDispatcher) | |
| 24 | |
| 25 CustomElementMicrotaskDispatcher& CustomElementMicrotaskDispatcher::instance() | 23 CustomElementMicrotaskDispatcher& CustomElementMicrotaskDispatcher::instance() |
| 26 { | 24 { |
| 27 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CustomElementMicrotaskDispatcher>
, instance, (adoptPtrWillBeNoop(new CustomElementMicrotaskDispatcher()))); | 25 DEFINE_STATIC_LOCAL(Persistent<CustomElementMicrotaskDispatcher>, instance,
(new CustomElementMicrotaskDispatcher())); |
| 28 return *instance; | 26 return *instance; |
| 29 } | 27 } |
| 30 | 28 |
| 31 void CustomElementMicrotaskDispatcher::enqueue(CustomElementCallbackQueue* queue
) | 29 void CustomElementMicrotaskDispatcher::enqueue(CustomElementCallbackQueue* queue
) |
| 32 { | 30 { |
| 33 ensureMicrotaskScheduledForElementQueue(); | 31 ensureMicrotaskScheduledForElementQueue(); |
| 34 queue->setOwner(kMicrotaskQueueId); | 32 queue->setOwner(kMicrotaskQueueId); |
| 35 m_elements.append(queue); | 33 m_elements.append(queue); |
| 36 } | 34 } |
| 37 | 35 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 79 } |
| 82 | 80 |
| 83 DEFINE_TRACE(CustomElementMicrotaskDispatcher) | 81 DEFINE_TRACE(CustomElementMicrotaskDispatcher) |
| 84 { | 82 { |
| 85 #if ENABLE(OILPAN) | 83 #if ENABLE(OILPAN) |
| 86 visitor->trace(m_elements); | 84 visitor->trace(m_elements); |
| 87 #endif | 85 #endif |
| 88 } | 86 } |
| 89 | 87 |
| 90 } // namespace blink | 88 } // namespace blink |
| OLD | NEW |