Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / dom / custom / CustomElementCallbackDispatcher.cpp
index b3bc522..5753c29 100644 (file)
 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
 
 #include "core/dom/custom/CustomElementCallbackQueue.h"
+#include "core/dom/custom/CustomElementScheduler.h"
 #include "wtf/MainThread.h"
 
-namespace WebCore {
+namespace blink {
 
 size_t CustomElementCallbackDispatcher::s_elementQueueStart = 0;
 
@@ -73,6 +74,9 @@ void CustomElementCallbackDispatcher::processElementQueueAndPop(size_t start, si
     // Pop the element queue from the processing stack
     m_flattenedProcessingStack.resize(start);
     s_elementQueueEnd = start;
+
+    if (s_elementQueueStart == kNumSentinels)
+        CustomElementScheduler::callbackDispatcherDidFinish();
 }
 
 void CustomElementCallbackDispatcher::enqueue(CustomElementCallbackQueue* callbackQueue)
@@ -88,4 +92,4 @@ void CustomElementCallbackDispatcher::enqueue(CustomElementCallbackQueue* callba
     ++s_elementQueueEnd;
 }
 
-} // namespace WebCore
+} // namespace blink