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 CustomElementMicrotaskDispatcher_h |
6 #define CustomElementMicrotaskDispatcher_h | 6 #define CustomElementMicrotaskDispatcher_h |
7 | 7 |
8 #include "core/dom/custom/CustomElementMicrotaskQueue.h" | |
9 #include "wtf/Noncopyable.h" | 8 #include "wtf/Noncopyable.h" |
10 #include "wtf/PassOwnPtr.h" | 9 #include "wtf/PassOwnPtr.h" |
11 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
12 | 11 |
13 namespace WebCore { | 12 namespace WebCore { |
14 | 13 |
14 class CustomElementAsyncImportMicrotaskQueue; | |
15 class CustomElementCallbackQueue; | 15 class CustomElementCallbackQueue; |
16 class CustomElementMicrotaskImportStep; | 16 class CustomElementMicrotaskImportStep; |
17 class CustomElementMicrotaskQueue; | |
17 class CustomElementMicrotaskStep; | 18 class CustomElementMicrotaskStep; |
18 class HTMLImportLoader; | 19 class HTMLImportLoader; |
19 | 20 |
20 class CustomElementMicrotaskDispatcher { | 21 class CustomElementMicrotaskDispatcher { |
21 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskDispatcher); | 22 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskDispatcher); |
22 public: | 23 public: |
23 ~CustomElementMicrotaskDispatcher() { } | 24 ~CustomElementMicrotaskDispatcher(); |
24 | 25 |
25 static CustomElementMicrotaskDispatcher& instance(); | 26 static CustomElementMicrotaskDispatcher& instance(); |
26 | 27 |
27 void enqueue(HTMLImportLoader*, PassOwnPtr<CustomElementMicrotaskStep>); | 28 void enqueue(HTMLImportLoader*, PassOwnPtr<CustomElementMicrotaskStep>); |
28 void enqueue(CustomElementCallbackQueue*); | 29 void enqueue(CustomElementCallbackQueue*); |
30 void enqueueAsyncImportStep(PassOwnPtr<CustomElementMicrotaskImportStep>); | |
dominicc (has gone to gerrit)
2014/05/25 23:55:10
Why does the signature differ from enqueue(HTMLImp
Hajime Morrita
2014/05/27 21:12:47
As async steps go to top-level global queueue, the
dominicc (has gone to gerrit)
2014/05/27 23:41:25
Maybe we should name the parameter in the signatur
| |
29 | 31 |
30 void importDidFinish(CustomElementMicrotaskImportStep*); | 32 void importDidFinish(CustomElementMicrotaskImportStep*); |
31 | 33 |
32 bool elementQueueIsEmpty() { return m_elements.isEmpty(); } | 34 bool elementQueueIsEmpty() { return m_elements.isEmpty(); } |
33 | 35 |
34 #if !defined(NDEBUG) | 36 #if !defined(NDEBUG) |
35 void show(); | 37 void show(); |
36 #endif | 38 #endif |
37 | 39 |
38 private: | 40 private: |
39 CustomElementMicrotaskDispatcher(); | 41 CustomElementMicrotaskDispatcher(); |
40 | 42 |
41 void ensureMicrotaskScheduled(); | 43 void ensureMicrotaskScheduled(); |
42 | 44 |
43 static void dispatch(); | 45 static void dispatch(); |
44 void doDispatch(); | 46 void doDispatch(); |
45 | 47 |
46 bool m_hasScheduledMicrotask; | 48 bool m_hasScheduledMicrotask; |
47 enum { | 49 enum { |
48 Quiescent, | 50 Quiescent, |
49 Resolving, | 51 Resolving, |
50 DispatchingCallbacks | 52 DispatchingCallbacks |
51 } m_phase; | 53 } m_phase; |
52 | 54 |
53 RefPtr<CustomElementMicrotaskQueue> m_resolutionAndImports; | 55 RefPtr<CustomElementMicrotaskQueue> m_resolutionAndImports; |
56 RefPtr<CustomElementAsyncImportMicrotaskQueue> m_asyncImports; | |
54 Vector<CustomElementCallbackQueue*> m_elements; | 57 Vector<CustomElementCallbackQueue*> m_elements; |
55 }; | 58 }; |
56 | 59 |
57 } | 60 } |
58 | 61 |
59 #if !defined(NDEBUG) | 62 #if !defined(NDEBUG) |
60 void showCEMD(); | 63 void showCEMD(); |
61 #endif | 64 #endif |
62 | 65 |
63 #endif // CustomElementMicrotaskDispatcher_h | 66 #endif // CustomElementMicrotaskDispatcher_h |
OLD | NEW |