Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.h

Issue 2456773002: Clear the custom element's reaction queue if upgrade fails. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
22 22
23 public: 23 public:
24 CustomElementReactionStack(); 24 CustomElementReactionStack();
25 25
26 DECLARE_TRACE(); 26 DECLARE_TRACE();
27 27
28 void push(); 28 void push();
29 void popInvokingReactions(); 29 void popInvokingReactions();
30 void enqueueToCurrentQueue(Element*, CustomElementReaction*); 30 void enqueueToCurrentQueue(Element*, CustomElementReaction*);
31 void enqueueToBackupQueue(Element*, CustomElementReaction*); 31 void enqueueToBackupQueue(Element*, CustomElementReaction*);
32 void clearQueue(Element*);
32 33
33 static CustomElementReactionStack& current(); 34 static CustomElementReactionStack& current();
34 35
35 private: 36 private:
37 friend class CustomElementReactionStackTestSupport;
38
36 using ElementReactionQueueMap = 39 using ElementReactionQueueMap =
37 HeapHashMap<Member<Element>, Member<CustomElementReactionQueue>>; 40 HeapHashMap<Member<Element>, Member<CustomElementReactionQueue>>;
38 ElementReactionQueueMap m_map; 41 ElementReactionQueueMap m_map;
39 42
40 using ElementQueue = HeapVector<Member<Element>, 1>; 43 using ElementQueue = HeapVector<Member<Element>, 1>;
41 HeapVector<Member<ElementQueue>> m_stack; 44 HeapVector<Member<ElementQueue>> m_stack;
42 Member<ElementQueue> m_backupQueue; 45 Member<ElementQueue> m_backupQueue;
43 46
44 void invokeBackupQueue(); 47 void invokeBackupQueue();
45 void invokeReactions(ElementQueue&); 48 void invokeReactions(ElementQueue&);
46 void enqueue(Member<ElementQueue>&, Element*, CustomElementReaction*); 49 void enqueue(Member<ElementQueue>&, Element*, CustomElementReaction*);
47 }; 50 };
48 51
52 class CORE_EXPORT CustomElementReactionStackTestSupport final {
53 private:
54 friend class ResetCustomElementReactionStackForTest;
55
56 CustomElementReactionStackTestSupport() = delete;
57 static CustomElementReactionStack* setCurrentForTest(
58 CustomElementReactionStack*);
59 };
60
49 } // namespace blink 61 } // namespace blink
50 62
51 #endif // CustomElementReactionStack_h 63 #endif // CustomElementReactionStack_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698