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

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

Issue 2306923002: Prevent recursion in critical part of CustomElementRegistry::define. (Closed)
Patch Set: Feedback Created 4 years, 3 months 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 CustomElementRegistry_h 5 #ifndef CustomElementRegistry_h
6 #define CustomElementRegistry_h 6 #define CustomElementRegistry_h
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "core/CoreExport.h" 11 #include "core/CoreExport.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 #include "wtf/HashSet.h"
14 #include "wtf/Noncopyable.h" 13 #include "wtf/Noncopyable.h"
15 #include "wtf/text/AtomicString.h" 14 #include "wtf/text/AtomicString.h"
16 #include "wtf/text/AtomicStringHash.h" 15 #include "wtf/text/AtomicStringHash.h"
17 16
18 namespace blink { 17 namespace blink {
19 18
20 class CustomElementDefinition; 19 class CustomElementDefinition;
21 class CustomElementDefinitionBuilder; 20 class CustomElementDefinitionBuilder;
22 class CustomElementDescriptor; 21 class CustomElementDescriptor;
23 class Element; 22 class Element;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 friend class CustomElementRegistryTest; 75 friend class CustomElementRegistryTest;
77 76
78 CustomElementRegistry(const LocalDOMWindow*); 77 CustomElementRegistry(const LocalDOMWindow*);
79 78
80 bool v0NameIsDefined(const AtomicString& name); 79 bool v0NameIsDefined(const AtomicString& name);
81 80
82 void collectCandidates( 81 void collectCandidates(
83 const CustomElementDescriptor&, 82 const CustomElementDescriptor&,
84 HeapVector<Member<Element>>*); 83 HeapVector<Member<Element>>*);
85 84
86 class NameIsBeingDefined; 85 class ElementDefinitionIsRunning;
86 bool m_elementDefinitionIsRunning;
87 87
88 HashSet<AtomicString> m_namesBeingDefined;
89 using DefinitionMap = 88 using DefinitionMap =
90 HeapHashMap<AtomicString, Member<CustomElementDefinition>>; 89 HeapHashMap<AtomicString, Member<CustomElementDefinition>>;
91 DefinitionMap m_definitions; 90 DefinitionMap m_definitions;
92 91
93 Member<const LocalDOMWindow> m_owner; 92 Member<const LocalDOMWindow> m_owner;
94 93
95 using V0RegistrySet = HeapHashSet<WeakMember<V0CustomElementRegistrationCont ext>>; 94 using V0RegistrySet = HeapHashSet<WeakMember<V0CustomElementRegistrationCont ext>>;
96 Member<V0RegistrySet> m_v0; 95 Member<V0RegistrySet> m_v0;
97 96
98 using UpgradeCandidateSet = HeapHashSet<WeakMember<Element>>; 97 using UpgradeCandidateSet = HeapHashSet<WeakMember<Element>>;
99 using UpgradeCandidateMap = HeapHashMap< 98 using UpgradeCandidateMap = HeapHashMap<
100 AtomicString, 99 AtomicString,
101 Member<UpgradeCandidateSet>>; 100 Member<UpgradeCandidateSet>>;
102 Member<UpgradeCandidateMap> m_upgradeCandidates; 101 Member<UpgradeCandidateMap> m_upgradeCandidates;
103 102
104 using WhenDefinedPromiseMap = 103 using WhenDefinedPromiseMap =
105 HeapHashMap<AtomicString, Member<ScriptPromiseResolver>>; 104 HeapHashMap<AtomicString, Member<ScriptPromiseResolver>>;
106 WhenDefinedPromiseMap m_whenDefinedPromiseMap; 105 WhenDefinedPromiseMap m_whenDefinedPromiseMap;
107 }; 106 };
108 107
109 } // namespace blink 108 } // namespace blink
110 109
111 #endif // CustomElementRegistry_h 110 #endif // CustomElementRegistry_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698