Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h |
| index c2b10c03da91e9a412ea1ae7f859050a70106726..9d28522785205217133f2072bc19715423819624 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h |
| @@ -10,11 +10,8 @@ |
| #include "core/CoreExport.h" |
| #include "core/dom/custom/CustomElementDefinition.h" |
| #include "v8.h" |
| -#include "wtf/HashSet.h" |
| #include "wtf/Noncopyable.h" |
| #include "wtf/RefPtr.h" |
| -#include "wtf/text/AtomicString.h" |
| -#include "wtf/text/AtomicStringHash.h" |
| namespace blink { |
| @@ -36,9 +33,9 @@ public: |
| const CustomElementDescriptor&, |
| const v8::Local<v8::Object>& constructor, |
| const v8::Local<v8::Object>& prototype, |
| - const v8::Local<v8::Object>& connectedCallback, |
| - const v8::Local<v8::Object>& disconnectedCallback, |
| - const v8::Local<v8::Object>& attributeChangedCallback, |
| + const v8::Local<v8::Function>& connectedCallback, |
| + const v8::Local<v8::Function>& disconnectedCallback, |
| + const v8::Local<v8::Function>& attributeChangedCallback, |
| const HashSet<AtomicString>& observedAttributes); |
| virtual ~ScriptCustomElementDefinition() = default; |
| @@ -46,28 +43,38 @@ public: |
| v8::Local<v8::Object> constructor() const; |
| v8::Local<v8::Object> prototype() const; |
| + bool hasConnectedCallback() const override; |
| + bool hasDisconnectedCallback() const override; |
| + |
| + void runConnectedCallback(Element*) override; |
| + void runDisconnectedCallback(Element*) override; |
| + void runAttributeChangedCallback(Element*, const QualifiedName&, |
| + const AtomicString& oldValue, const AtomicString& newValue) override; |
| + |
| private: |
| ScriptCustomElementDefinition( |
| ScriptState*, |
| const CustomElementDescriptor&, |
| const v8::Local<v8::Object>& constructor, |
| const v8::Local<v8::Object>& prototype, |
| - const v8::Local<v8::Object>& connectedCallback, |
| - const v8::Local<v8::Object>& disconnectedCallback, |
| - const v8::Local<v8::Object>& attributeChangedCallback, |
| + const v8::Local<v8::Function>& connectedCallback, |
| + const v8::Local<v8::Function>& disconnectedCallback, |
| + const v8::Local<v8::Function>& attributeChangedCallback, |
| const HashSet<AtomicString>& observedAttributes); |
| // Implementations of |CustomElementDefinition| |
| ScriptValue getConstructorForScript() final; |
| bool runConstructor(Element*) override; |
| + void runCallback(ScopedPersistent<v8::Function>&, Element*, |
|
haraken
2016/06/14 11:39:24
Nit: Change the parameter type to v8::Local<v8::Fu
|
| + int argc = 0, v8::Local<v8::Value> argv[] = nullptr); |
| + |
| RefPtr<ScriptState> m_scriptState; |
| ScopedPersistent<v8::Object> m_constructor; |
| ScopedPersistent<v8::Object> m_prototype; |
| - ScopedPersistent<v8::Object> m_connectedCallback; |
| - ScopedPersistent<v8::Object> m_disconnectedCallback; |
| - ScopedPersistent<v8::Object> m_attributeChangedCallback; |
| - HashSet<AtomicString> m_observedAttributes; |
| + ScopedPersistent<v8::Function> m_connectedCallback; |
| + ScopedPersistent<v8::Function> m_disconnectedCallback; |
| + ScopedPersistent<v8::Function> m_attributeChangedCallback; |
| }; |
| } // namespace blink |