OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CustomElementMicrotaskDispatcher_h |
| 6 #define CustomElementMicrotaskDispatcher_h |
| 7 |
| 8 #include "core/dom/custom/CustomElementMicrotaskQueue.h" |
| 9 #include "wtf/Noncopyable.h" |
| 10 #include "wtf/PassOwnPtr.h" |
| 11 #include "wtf/Vector.h" |
| 12 |
| 13 namespace WebCore { |
| 14 |
| 15 class CustomElementCallbackQueue; |
| 16 class CustomElementMicrotaskStep; |
| 17 class HTMLImport; |
| 18 |
| 19 class CustomElementMicrotaskDispatcher { |
| 20 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskDispatcher); |
| 21 public: |
| 22 CustomElementMicrotaskDispatcher() : m_phase(Quiescent) { } |
| 23 ~CustomElementMicrotaskDispatcher() { } |
| 24 |
| 25 void enqueue(HTMLImport*, PassOwnPtr<CustomElementMicrotaskStep>); |
| 26 void enqueue(CustomElementCallbackQueue*); |
| 27 bool dispatch(); |
| 28 bool elementQueueIsEmpty() { return m_elements.isEmpty(); } |
| 29 |
| 30 private: |
| 31 enum { |
| 32 Quiescent, |
| 33 Resolving, |
| 34 DispatchingCallbacks |
| 35 } m_phase; |
| 36 |
| 37 CustomElementMicrotaskQueue m_resolutionAndImports; |
| 38 Vector<CustomElementCallbackQueue*> m_elements; |
| 39 }; |
| 40 |
| 41 } |
| 42 |
| 43 #endif // CustomElementMicrotaskDispatcher_h |
OLD | NEW |