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 ScriptCustomElementDefinitionBuilder_h | 5 #ifndef ScriptCustomElementDefinitionBuilder_h |
6 #define ScriptCustomElementDefinitionBuilder_h | 6 #define ScriptCustomElementDefinitionBuilder_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/dom/custom/CustomElementDefinitionBuilder.h" | 9 #include "core/dom/custom/CustomElementDefinitionBuilder.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "v8.h" | 11 #include "v8.h" |
12 #include "wtf/Allocator.h" | 12 #include "wtf/Allocator.h" |
| 13 #include "wtf/HashSet.h" |
13 #include "wtf/Noncopyable.h" | 14 #include "wtf/Noncopyable.h" |
14 #include "wtf/RefPtr.h" | 15 #include "wtf/RefPtr.h" |
| 16 #include "wtf/text/AtomicString.h" |
| 17 #include "wtf/text/AtomicStringHash.h" |
15 | 18 |
16 namespace blink { | 19 namespace blink { |
17 | 20 |
18 class CustomElementsRegistry; | 21 class CustomElementsRegistry; |
19 class ExceptionState; | 22 class ExceptionState; |
20 class ScriptState; | 23 class ScriptState; |
21 class ScriptValue; | 24 class ScriptValue; |
22 | 25 |
23 class CORE_EXPORT ScriptCustomElementDefinitionBuilder | 26 class CORE_EXPORT ScriptCustomElementDefinitionBuilder |
24 : public CustomElementDefinitionBuilder { | 27 : public CustomElementDefinitionBuilder { |
25 STACK_ALLOCATED(); | 28 STACK_ALLOCATED(); |
26 WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinitionBuilder); | 29 WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinitionBuilder); |
27 public: | 30 public: |
28 ScriptCustomElementDefinitionBuilder( | 31 ScriptCustomElementDefinitionBuilder( |
29 ScriptState*, | 32 ScriptState*, |
30 CustomElementsRegistry*, | 33 CustomElementsRegistry*, |
31 const ScriptValue& constructorScriptValue, | 34 const ScriptValue& constructorScriptValue, |
32 ExceptionState&); | 35 ExceptionState&); |
33 ~ScriptCustomElementDefinitionBuilder(); | 36 ~ScriptCustomElementDefinitionBuilder(); |
34 | 37 |
35 bool checkConstructorIntrinsics() override; | 38 bool checkConstructorIntrinsics() override; |
36 bool checkConstructorNotRegistered() override; | 39 bool checkConstructorNotRegistered() override; |
37 bool checkPrototype() override; | 40 bool checkPrototype() override; |
| 41 bool rememberOriginalProperties() override; |
38 CustomElementDefinition* build(const CustomElementDescriptor&) override; | 42 CustomElementDefinition* build(const CustomElementDescriptor&) override; |
39 | 43 |
40 private: | 44 private: |
41 static ScriptCustomElementDefinitionBuilder* s_stack; | 45 static ScriptCustomElementDefinitionBuilder* s_stack; |
42 | 46 |
43 ScriptCustomElementDefinitionBuilder* m_prev; | 47 ScriptCustomElementDefinitionBuilder* m_prev; |
44 RefPtr<ScriptState> m_scriptState; | 48 RefPtr<ScriptState> m_scriptState; |
45 Member<CustomElementsRegistry> m_registry; | 49 Member<CustomElementsRegistry> m_registry; |
46 v8::Local<v8::Value> m_constructorValue; | 50 v8::Local<v8::Value> m_constructorValue; |
47 v8::Local<v8::Object> m_constructor; | 51 v8::Local<v8::Object> m_constructor; |
48 v8::Local<v8::Object> m_prototype; | 52 v8::Local<v8::Object> m_prototype; |
| 53 v8::Local<v8::Object> m_connectedCallback; |
| 54 v8::Local<v8::Object> m_disconnectedCallback; |
| 55 v8::Local<v8::Object> m_attributeChangedCallback; |
| 56 HashSet<AtomicString> m_observedAttributes; |
49 ExceptionState& m_exceptionState; | 57 ExceptionState& m_exceptionState; |
| 58 |
| 59 bool valueForName(const v8::Local<v8::Object>&, const String&, v8::Local<v8:
:Value>&) const; |
| 60 bool callableForName(const String&, v8::Local<v8::Object>&) const; |
| 61 bool retrieveObservedAttributes(); |
50 }; | 62 }; |
51 | 63 |
52 } // namespace blink | 64 } // namespace blink |
53 | 65 |
54 #endif // ScriptCustomElementDefinitionBuilder_h | 66 #endif // ScriptCustomElementDefinitionBuilder_h |
OLD | NEW |