| 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 "bindings/core/v8/ScriptState.h" | |
| 10 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 11 #include "core/dom/custom/CustomElementDefinition.h" | 10 #include "core/dom/custom/CustomElementDefinition.h" |
| 12 #include "v8.h" | 11 #include "v8.h" |
| 13 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
| 14 #include "wtf/RefPtr.h" | |
| 15 | 13 |
| 16 namespace blink { | 14 namespace blink { |
| 17 | 15 |
| 18 class CustomElementDescriptor; | 16 class CustomElementDescriptor; |
| 19 class CustomElementsRegistry; | 17 class CustomElementsRegistry; |
| 18 class ScriptState; |
| 20 | 19 |
| 21 class CORE_EXPORT ScriptCustomElementDefinition final : | 20 class CORE_EXPORT ScriptCustomElementDefinition final : |
| 22 public CustomElementDefinition { | 21 public CustomElementDefinition { |
| 23 WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinition); | 22 WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinition); |
| 24 public: | 23 public: |
| 25 static ScriptCustomElementDefinition* forConstructor( | 24 static ScriptCustomElementDefinition* forConstructor( |
| 26 ScriptState*, | 25 ScriptState*, |
| 27 CustomElementsRegistry*, | 26 CustomElementsRegistry*, |
| 28 const v8::Local<v8::Value>& constructor); | 27 const v8::Local<v8::Value>& constructor); |
| 29 | 28 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 ScriptCustomElementDefinition( | 42 ScriptCustomElementDefinition( |
| 44 ScriptState*, | 43 ScriptState*, |
| 45 const CustomElementDescriptor&, | 44 const CustomElementDescriptor&, |
| 46 const v8::Local<v8::Object>& constructor, | 45 const v8::Local<v8::Object>& constructor, |
| 47 const v8::Local<v8::Object>& prototype); | 46 const v8::Local<v8::Object>& prototype); |
| 48 | 47 |
| 49 // Implementations of |CustomElementDefinition| | 48 // Implementations of |CustomElementDefinition| |
| 50 ScriptValue getConstructorForScript() final; | 49 ScriptValue getConstructorForScript() final; |
| 51 bool runConstructor(Element*) override; | |
| 52 | 50 |
| 53 RefPtr<ScriptState> m_scriptState; | 51 RefPtr<ScriptState> m_scriptState; |
| 54 ScopedPersistent<v8::Object> m_constructor; | 52 ScopedPersistent<v8::Object> m_constructor; |
| 55 ScopedPersistent<v8::Object> m_prototype; | 53 ScopedPersistent<v8::Object> m_prototype; |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 } // namespace blink | 56 } // namespace blink |
| 59 | 57 |
| 60 #endif // ScriptCustomElementDefinition_h | 58 #endif // ScriptCustomElementDefinition_h |
| OLD | NEW |