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 CustomElementsRegistry_h | 5 #ifndef CustomElementRegistry_h |
6 #define CustomElementsRegistry_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" | 13 #include "wtf/HashSet.h" |
14 #include "wtf/Noncopyable.h" | 14 #include "wtf/Noncopyable.h" |
15 #include "wtf/text/AtomicString.h" | 15 #include "wtf/text/AtomicString.h" |
16 #include "wtf/text/AtomicStringHash.h" | 16 #include "wtf/text/AtomicStringHash.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class CustomElementDefinition; | 20 class CustomElementDefinition; |
21 class CustomElementDefinitionBuilder; | 21 class CustomElementDefinitionBuilder; |
22 class CustomElementDescriptor; | 22 class CustomElementDescriptor; |
23 class Element; | 23 class Element; |
24 class ElementRegistrationOptions; | 24 class ElementRegistrationOptions; |
25 class ExceptionState; | 25 class ExceptionState; |
26 class LocalDOMWindow; | 26 class LocalDOMWindow; |
27 class ScriptPromiseResolver; | 27 class ScriptPromiseResolver; |
28 class ScriptState; | 28 class ScriptState; |
29 class ScriptValue; | 29 class ScriptValue; |
30 class V0CustomElementRegistrationContext; | 30 class V0CustomElementRegistrationContext; |
31 | 31 |
32 class CORE_EXPORT CustomElementsRegistry final | 32 class CORE_EXPORT CustomElementRegistry final |
33 : public GarbageCollectedFinalized<CustomElementsRegistry> | 33 : public GarbageCollectedFinalized<CustomElementRegistry> |
34 , public ScriptWrappable { | 34 , public ScriptWrappable { |
35 DEFINE_WRAPPERTYPEINFO(); | 35 DEFINE_WRAPPERTYPEINFO(); |
36 WTF_MAKE_NONCOPYABLE(CustomElementsRegistry); | 36 WTF_MAKE_NONCOPYABLE(CustomElementRegistry); |
37 public: | 37 public: |
38 static CustomElementsRegistry* create(const LocalDOMWindow*); | 38 static CustomElementRegistry* create(const LocalDOMWindow*); |
39 | 39 |
40 virtual ~CustomElementsRegistry() = default; | 40 virtual ~CustomElementRegistry() = default; |
41 | 41 |
42 void define( | 42 void define( |
43 ScriptState*, | 43 ScriptState*, |
44 const AtomicString& name, | 44 const AtomicString& name, |
45 const ScriptValue& constructor, | 45 const ScriptValue& constructor, |
46 const ElementRegistrationOptions&, | 46 const ElementRegistrationOptions&, |
47 ExceptionState&); | 47 ExceptionState&); |
48 | 48 |
49 void define( | 49 void define( |
50 const AtomicString& name, | 50 const AtomicString& name, |
(...skipping 15 matching lines...) Expand all Loading... |
66 ScriptPromise whenDefined( | 66 ScriptPromise whenDefined( |
67 ScriptState*, | 67 ScriptState*, |
68 const AtomicString& name, | 68 const AtomicString& name, |
69 ExceptionState&); | 69 ExceptionState&); |
70 | 70 |
71 void entangle(V0CustomElementRegistrationContext*); | 71 void entangle(V0CustomElementRegistrationContext*); |
72 | 72 |
73 DECLARE_TRACE(); | 73 DECLARE_TRACE(); |
74 | 74 |
75 private: | 75 private: |
76 friend class CustomElementsRegistryTest; | 76 friend class CustomElementRegistryTest; |
77 | 77 |
78 CustomElementsRegistry(const LocalDOMWindow*); | 78 CustomElementRegistry(const LocalDOMWindow*); |
79 | 79 |
80 bool v0NameIsDefined(const AtomicString& name); | 80 bool v0NameIsDefined(const AtomicString& name); |
81 | 81 |
82 void collectCandidates( | 82 void collectCandidates( |
83 const CustomElementDescriptor&, | 83 const CustomElementDescriptor&, |
84 HeapVector<Member<Element>>*); | 84 HeapVector<Member<Element>>*); |
85 | 85 |
86 class NameIsBeingDefined; | 86 class NameIsBeingDefined; |
87 | 87 |
88 HashSet<AtomicString> m_namesBeingDefined; | 88 HashSet<AtomicString> m_namesBeingDefined; |
(...skipping 12 matching lines...) Expand all Loading... |
101 Member<UpgradeCandidateSet>>; | 101 Member<UpgradeCandidateSet>>; |
102 Member<UpgradeCandidateMap> m_upgradeCandidates; | 102 Member<UpgradeCandidateMap> m_upgradeCandidates; |
103 | 103 |
104 using WhenDefinedPromiseMap = | 104 using WhenDefinedPromiseMap = |
105 HeapHashMap<AtomicString, Member<ScriptPromiseResolver>>; | 105 HeapHashMap<AtomicString, Member<ScriptPromiseResolver>>; |
106 WhenDefinedPromiseMap m_whenDefinedPromiseMap; | 106 WhenDefinedPromiseMap m_whenDefinedPromiseMap; |
107 }; | 107 }; |
108 | 108 |
109 } // namespace blink | 109 } // namespace blink |
110 | 110 |
111 #endif // CustomElementsRegistry_h | 111 #endif // CustomElementRegistry_h |
OLD | NEW |