Index: Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp |
diff --git a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp |
index 31c14b69e6a4b7894107edf1088b29023e3b9d6a..2adc2d15469b1c60ce7f39dec82b78d39e19ee80 100644 |
--- a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp |
+++ b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp |
@@ -6,13 +6,11 @@ |
#include "core/dom/custom/CustomElementMicrotaskDispatcher.h" |
#include "core/dom/Microtask.h" |
-#include "core/dom/custom/CustomElementAsyncImportMicrotaskQueue.h" |
#include "core/dom/custom/CustomElementCallbackDispatcher.h" |
#include "core/dom/custom/CustomElementCallbackQueue.h" |
#include "core/dom/custom/CustomElementMicrotaskImportStep.h" |
-#include "core/dom/custom/CustomElementMicrotaskQueue.h" |
+#include "core/dom/custom/CustomElementMicrotaskStepDispatcher.h" |
#include "core/dom/custom/CustomElementScheduler.h" |
-#include "core/html/imports/HTMLImportLoader.h" |
#include "wtf/MainThread.h" |
namespace WebCore { |
@@ -22,8 +20,7 @@ static const CustomElementCallbackQueue::ElementQueueId kMicrotaskQueueId = 0; |
CustomElementMicrotaskDispatcher::CustomElementMicrotaskDispatcher() |
: m_hasScheduledMicrotask(false) |
, m_phase(Quiescent) |
- , m_resolutionAndImports(CustomElementMicrotaskQueue::create()) |
- , m_asyncImports(CustomElementAsyncImportMicrotaskQueue::create()) |
+ , m_steps(CustomElementMicrotaskStepDispatcher::create()) |
{ |
} |
@@ -38,19 +35,13 @@ CustomElementMicrotaskDispatcher& CustomElementMicrotaskDispatcher::instance() |
void CustomElementMicrotaskDispatcher::enqueue(HTMLImportLoader* parentLoader, PassOwnPtrWillBeRawPtr<CustomElementMicrotaskStep> step) |
{ |
ensureMicrotaskScheduledForMicrotaskSteps(); |
- if (parentLoader) |
- parentLoader->microtaskQueue()->enqueue(step); |
- else |
- m_resolutionAndImports->enqueue(step); |
+ m_steps->enqueue(parentLoader, step); |
} |
void CustomElementMicrotaskDispatcher::enqueue(HTMLImportLoader* parentLoader, PassOwnPtrWillBeRawPtr<CustomElementMicrotaskImportStep> step, bool importIsSync) |
{ |
ensureMicrotaskScheduledForMicrotaskSteps(); |
- if (importIsSync) |
- enqueue(parentLoader, PassOwnPtrWillBeRawPtr<CustomElementMicrotaskStep>(step)); |
- else |
- m_asyncImports->enqueue(step); |
+ m_steps->enqueue(parentLoader, step, importIsSync); |
} |
void CustomElementMicrotaskDispatcher::enqueue(CustomElementCallbackQueue* queue) |
@@ -103,9 +94,7 @@ void CustomElementMicrotaskDispatcher::doDispatch() |
ASSERT_WITH_SECURITY_IMPLICATION(!CustomElementCallbackDispatcher::inCallbackDeliveryScope()); |
m_phase = Resolving; |
- m_resolutionAndImports->dispatch(); |
- if (m_resolutionAndImports->isEmpty()) |
- m_asyncImports->dispatch(); |
+ m_steps->dispatch(); |
m_phase = DispatchingCallbacks; |
for (WillBeHeapVector<RawPtrWillBeMember<CustomElementCallbackQueue> >::iterator it = m_elements.begin(); it != m_elements.end(); ++it) { |
@@ -121,8 +110,7 @@ void CustomElementMicrotaskDispatcher::doDispatch() |
void CustomElementMicrotaskDispatcher::trace(Visitor* visitor) |
{ |
- visitor->trace(m_resolutionAndImports); |
- visitor->trace(m_asyncImports); |
+ visitor->trace(m_steps); |
#if ENABLE(OILPAN) |
visitor->trace(m_elements); |
#endif |
@@ -131,11 +119,7 @@ void CustomElementMicrotaskDispatcher::trace(Visitor* visitor) |
#if !defined(NDEBUG) |
void CustomElementMicrotaskDispatcher::show() |
{ |
- fprintf(stderr, "Dispatcher:\n"); |
- fprintf(stderr, " Sync:\n"); |
- m_resolutionAndImports->show(3); |
- fprintf(stderr, " Async:\n"); |
- m_asyncImports->show(3); |
+ m_steps->show(2); |
} |
#endif |