OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ScriptCustomElementDefinition_h |
| 6 #define ScriptCustomElementDefinition_h |
| 7 |
| 8 #include "bindings/core/v8/ScopedPersistent.h" |
| 9 #include "core/CoreExport.h" |
| 10 #include "core/dom/custom/CustomElementDefinition.h" |
| 11 #include "v8.h" |
| 12 #include "wtf/Noncopyable.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class CustomElementDescriptor; |
| 17 class CustomElementsRegistry; |
| 18 class ScriptState; |
| 19 |
| 20 class CORE_EXPORT ScriptCustomElementDefinition final : |
| 21 public CustomElementDefinition { |
| 22 WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinition); |
| 23 public: |
| 24 static ScriptCustomElementDefinition* forConstructor( |
| 25 ScriptState*, |
| 26 CustomElementsRegistry*, |
| 27 const v8::Local<v8::Value>& constructor); |
| 28 |
| 29 static ScriptCustomElementDefinition* create( |
| 30 ScriptState*, |
| 31 CustomElementsRegistry*, |
| 32 const CustomElementDescriptor&, |
| 33 const v8::Local<v8::Object>& constructor, |
| 34 const v8::Local<v8::Object>& prototype); |
| 35 |
| 36 virtual ~ScriptCustomElementDefinition() = default; |
| 37 |
| 38 v8::Local<v8::Object> constructor(ScriptState*) const; |
| 39 v8::Local<v8::Object> prototype(ScriptState*) const; |
| 40 |
| 41 private: |
| 42 ScriptCustomElementDefinition( |
| 43 ScriptState*, |
| 44 const CustomElementDescriptor&, |
| 45 const v8::Local<v8::Object>& constructor, |
| 46 const v8::Local<v8::Object>& prototype); |
| 47 |
| 48 ScopedPersistent<v8::Object> m_constructor; |
| 49 ScopedPersistent<v8::Object> m_prototype; |
| 50 }; |
| 51 |
| 52 } // namespace blink |
| 53 |
| 54 #endif // ScriptCustomElementDefinition_h |
OLD | NEW |