| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CustomElementReactionStack_h | 5 #ifndef CustomElementReactionStack_h |
| 6 #define CustomElementReactionStack_h | 6 #define CustomElementReactionStack_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 CustomElementReactionStack(); | 23 CustomElementReactionStack(); |
| 24 | 24 |
| 25 DECLARE_TRACE(); | 25 DECLARE_TRACE(); |
| 26 | 26 |
| 27 void push(); | 27 void push(); |
| 28 void popInvokingReactions(); | 28 void popInvokingReactions(); |
| 29 void enqueueToCurrentQueue(Element*, CustomElementReaction*); | 29 void enqueueToCurrentQueue(Element*, CustomElementReaction*); |
| 30 void enqueueToBackupQueue(Element*, CustomElementReaction*); | 30 void enqueueToBackupQueue(Element*, CustomElementReaction*); |
| 31 | 31 |
| 32 static CustomElementReactionStack& current(); |
| 33 |
| 32 private: | 34 private: |
| 33 using ElementReactionQueueMap = | 35 using ElementReactionQueueMap = |
| 34 HeapHashMap<Member<Element>, Member<CustomElementReactionQueue>>; | 36 HeapHashMap<Member<Element>, Member<CustomElementReactionQueue>>; |
| 35 ElementReactionQueueMap m_map; | 37 ElementReactionQueueMap m_map; |
| 36 | 38 |
| 37 using ElementQueue = HeapVector<Member<Element>, 1>; | 39 using ElementQueue = HeapVector<Member<Element>, 1>; |
| 38 HeapVector<Member<ElementQueue>> m_stack; | 40 HeapVector<Member<ElementQueue>> m_stack; |
| 39 Member<ElementQueue> m_backupQueue; | 41 Member<ElementQueue> m_backupQueue; |
| 40 | 42 |
| 41 void invokeBackupQueue(); | 43 void invokeBackupQueue(); |
| 42 void invokeReactions(ElementQueue&); | 44 void invokeReactions(ElementQueue&); |
| 43 void enqueue(Member<ElementQueue>&, Element*, CustomElementReaction*); | 45 void enqueue(Member<ElementQueue>&, Element*, CustomElementReaction*); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 } // namespace blink | 48 } // namespace blink |
| 47 | 49 |
| 48 #endif // CustomElementReactionStack_h | 50 #endif // CustomElementReactionStack_h |
| OLD | NEW |