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 #ifndef CustomElementMicrotaskDispatcher_h | 5 #ifndef V0CustomElementMicrotaskDispatcher_h |
6 #define CustomElementMicrotaskDispatcher_h | 6 #define V0CustomElementMicrotaskDispatcher_h |
7 | 7 |
8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
9 #include "wtf/Noncopyable.h" | 9 #include "wtf/Noncopyable.h" |
10 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class CustomElementCallbackQueue; | 14 class V0CustomElementCallbackQueue; |
15 | 15 |
16 class CustomElementMicrotaskDispatcher final : public GarbageCollected<CustomEle
mentMicrotaskDispatcher> { | 16 class V0CustomElementMicrotaskDispatcher final : public GarbageCollected<V0Custo
mElementMicrotaskDispatcher> { |
17 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskDispatcher); | 17 WTF_MAKE_NONCOPYABLE(V0CustomElementMicrotaskDispatcher); |
18 public: | 18 public: |
19 static CustomElementMicrotaskDispatcher& instance(); | 19 static V0CustomElementMicrotaskDispatcher& instance(); |
20 | 20 |
21 void enqueue(CustomElementCallbackQueue*); | 21 void enqueue(V0CustomElementCallbackQueue*); |
22 | 22 |
23 bool elementQueueIsEmpty() { return m_elements.isEmpty(); } | 23 bool elementQueueIsEmpty() { return m_elements.isEmpty(); } |
24 | 24 |
25 DECLARE_TRACE(); | 25 DECLARE_TRACE(); |
26 | 26 |
27 private: | 27 private: |
28 CustomElementMicrotaskDispatcher(); | 28 V0CustomElementMicrotaskDispatcher(); |
29 | 29 |
30 void ensureMicrotaskScheduledForElementQueue(); | 30 void ensureMicrotaskScheduledForElementQueue(); |
31 void ensureMicrotaskScheduled(); | 31 void ensureMicrotaskScheduled(); |
32 | 32 |
33 static void dispatch(); | 33 static void dispatch(); |
34 void doDispatch(); | 34 void doDispatch(); |
35 | 35 |
36 bool m_hasScheduledMicrotask; | 36 bool m_hasScheduledMicrotask; |
37 enum { | 37 enum { |
38 Quiescent, | 38 Quiescent, |
39 Resolving, | 39 Resolving, |
40 DispatchingCallbacks | 40 DispatchingCallbacks |
41 } m_phase; | 41 } m_phase; |
42 | 42 |
43 HeapVector<Member<CustomElementCallbackQueue>> m_elements; | 43 HeapVector<Member<V0CustomElementCallbackQueue>> m_elements; |
44 }; | 44 }; |
45 | 45 |
46 } // namespace blink | 46 } // namespace blink |
47 | 47 |
48 #endif // CustomElementMicrotaskDispatcher_h | 48 #endif // V0CustomElementMicrotaskDispatcher_h |
OLD | NEW |