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 ScriptCustomElementDefinition_h | 5 #ifndef ScriptCustomElementDefinition_h |
6 #define ScriptCustomElementDefinition_h | 6 #define ScriptCustomElementDefinition_h |
7 | 7 |
8 #include "bindings/core/v8/ScopedPersistent.h" | 8 #include "bindings/core/v8/ScopedPersistent.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/dom/custom/CustomElementDefinition.h" | 10 #include "core/dom/custom/CustomElementDefinition.h" |
11 #include "v8.h" | 11 #include "v8.h" |
| 12 #include "wtf/HashSet.h" |
12 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
| 14 #include "wtf/text/AtomicString.h" |
| 15 #include "wtf/text/AtomicStringHash.h" |
13 | 16 |
14 namespace blink { | 17 namespace blink { |
15 | 18 |
16 class CustomElementDescriptor; | 19 class CustomElementDescriptor; |
17 class CustomElementsRegistry; | 20 class CustomElementsRegistry; |
18 class ScriptState; | 21 class ScriptState; |
19 | 22 |
20 class CORE_EXPORT ScriptCustomElementDefinition final : | 23 class CORE_EXPORT ScriptCustomElementDefinition final : |
21 public CustomElementDefinition { | 24 public CustomElementDefinition { |
22 WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinition); | 25 WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinition); |
23 public: | 26 public: |
24 static ScriptCustomElementDefinition* forConstructor( | 27 static ScriptCustomElementDefinition* forConstructor( |
25 ScriptState*, | 28 ScriptState*, |
26 CustomElementsRegistry*, | 29 CustomElementsRegistry*, |
27 const v8::Local<v8::Value>& constructor); | 30 const v8::Local<v8::Value>& constructor); |
28 | 31 |
29 static ScriptCustomElementDefinition* create( | 32 static ScriptCustomElementDefinition* create( |
30 ScriptState*, | 33 ScriptState*, |
31 CustomElementsRegistry*, | 34 CustomElementsRegistry*, |
32 const CustomElementDescriptor&, | 35 const CustomElementDescriptor&, |
33 const v8::Local<v8::Object>& constructor, | 36 const v8::Local<v8::Object>& constructor, |
34 const v8::Local<v8::Object>& prototype); | 37 const v8::Local<v8::Object>& prototype, |
| 38 const v8::Local<v8::Object>& connectedCallback, |
| 39 const v8::Local<v8::Object>& disconnectedCallback, |
| 40 const v8::Local<v8::Object>& attributeChangedCallback, |
| 41 const HashSet<AtomicString>& observedAttributes); |
35 | 42 |
36 virtual ~ScriptCustomElementDefinition() = default; | 43 virtual ~ScriptCustomElementDefinition() = default; |
37 | 44 |
38 v8::Local<v8::Object> constructor() const; | 45 v8::Local<v8::Object> constructor() const; |
39 v8::Local<v8::Object> prototype() const; | 46 v8::Local<v8::Object> prototype() const; |
40 | 47 |
41 private: | 48 private: |
42 ScriptCustomElementDefinition( | 49 ScriptCustomElementDefinition( |
43 ScriptState*, | 50 ScriptState*, |
44 const CustomElementDescriptor&, | 51 const CustomElementDescriptor&, |
45 const v8::Local<v8::Object>& constructor, | 52 const v8::Local<v8::Object>& constructor, |
46 const v8::Local<v8::Object>& prototype); | 53 const v8::Local<v8::Object>& prototype, |
| 54 const v8::Local<v8::Object>& connectedCallback, |
| 55 const v8::Local<v8::Object>& disconnectedCallback, |
| 56 const v8::Local<v8::Object>& attributeChangedCallback, |
| 57 const HashSet<AtomicString>& observedAttributes); |
47 | 58 |
48 RefPtr<ScriptState> m_scriptState; | 59 RefPtr<ScriptState> m_scriptState; |
49 ScopedPersistent<v8::Object> m_constructor; | 60 ScopedPersistent<v8::Object> m_constructor; |
50 ScopedPersistent<v8::Object> m_prototype; | 61 ScopedPersistent<v8::Object> m_prototype; |
| 62 ScopedPersistent<v8::Object> m_connectedCallback; |
| 63 ScopedPersistent<v8::Object> m_disconnectedCallback; |
| 64 ScopedPersistent<v8::Object> m_attributeChangedCallback; |
| 65 HashSet<AtomicString> m_observedAttributes; |
51 }; | 66 }; |
52 | 67 |
53 } // namespace blink | 68 } // namespace blink |
54 | 69 |
55 #endif // ScriptCustomElementDefinition_h | 70 #endif // ScriptCustomElementDefinition_h |
OLD | NEW |