Chromium Code Reviews| 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" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 const v8::Local<v8::Function>& disconnectedCallback, | 37 const v8::Local<v8::Function>& disconnectedCallback, |
| 38 const v8::Local<v8::Function>& adoptedCallback, | 38 const v8::Local<v8::Function>& adoptedCallback, |
| 39 const v8::Local<v8::Function>& attributeChangedCallback, | 39 const v8::Local<v8::Function>& attributeChangedCallback, |
| 40 const HashSet<AtomicString>& observedAttributes); | 40 const HashSet<AtomicString>& observedAttributes); |
| 41 | 41 |
| 42 virtual ~ScriptCustomElementDefinition() = default; | 42 virtual ~ScriptCustomElementDefinition() = default; |
| 43 | 43 |
| 44 v8::Local<v8::Object> constructor() const; | 44 v8::Local<v8::Object> constructor() const; |
| 45 v8::Local<v8::Object> prototype() const; | 45 v8::Local<v8::Object> prototype() const; |
| 46 | 46 |
| 47 HTMLElement* createElementSync(Document&, const QualifiedName&) override; | 47 HTMLElement* createElementSync(Document&, const QualifiedName&, ExceptionSta te*) override; |
| 48 HTMLElement* createElementSync(Document&, const QualifiedName&, ExceptionSta te&) override; | |
| 49 | 48 |
| 50 bool hasConnectedCallback() const override; | 49 bool hasConnectedCallback() const override; |
| 51 bool hasDisconnectedCallback() const override; | 50 bool hasDisconnectedCallback() const override; |
| 52 bool hasAdoptedCallback() const override; | 51 bool hasAdoptedCallback() const override; |
| 53 | 52 |
| 54 void runConnectedCallback(Element*) override; | 53 void runConnectedCallback(Element*) override; |
| 55 void runDisconnectedCallback(Element*) override; | 54 void runDisconnectedCallback(Element*) override; |
| 56 void runAdoptedCallback(Element*) override; | 55 void runAdoptedCallback(Element*) override; |
| 57 void runAttributeChangedCallback(Element*, const QualifiedName&, | 56 void runAttributeChangedCallback(Element*, const QualifiedName&, |
| 58 const AtomicString& oldValue, const AtomicString& newValue) override; | 57 const AtomicString& oldValue, const AtomicString& newValue) override; |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 ScriptCustomElementDefinition( | 60 ScriptCustomElementDefinition( |
| 62 ScriptState*, | 61 ScriptState*, |
| 63 const CustomElementDescriptor&, | 62 const CustomElementDescriptor&, |
| 64 const v8::Local<v8::Object>& constructor, | 63 const v8::Local<v8::Object>& constructor, |
| 65 const v8::Local<v8::Object>& prototype, | 64 const v8::Local<v8::Object>& prototype, |
| 66 const v8::Local<v8::Function>& connectedCallback, | 65 const v8::Local<v8::Function>& connectedCallback, |
| 67 const v8::Local<v8::Function>& disconnectedCallback, | 66 const v8::Local<v8::Function>& disconnectedCallback, |
| 68 const v8::Local<v8::Function>& adoptedCallback, | 67 const v8::Local<v8::Function>& adoptedCallback, |
| 69 const v8::Local<v8::Function>& attributeChangedCallback, | 68 const v8::Local<v8::Function>& attributeChangedCallback, |
| 70 const HashSet<AtomicString>& observedAttributes); | 69 const HashSet<AtomicString>& observedAttributes); |
| 71 | 70 |
| 71 HTMLElement* createElementSync(Document&, const QualifiedName&); | |
| 72 HTMLElement* createElementSync(Document&, const QualifiedName&, ExceptionSta te&); | |
|
esprehn
2016/08/30 21:32:32
I think I'd give these different names? Having thi
| |
| 73 | |
| 72 // Implementations of |CustomElementDefinition| | 74 // Implementations of |CustomElementDefinition| |
| 73 ScriptValue getConstructorForScript() final; | 75 ScriptValue getConstructorForScript() final; |
| 74 bool runConstructor(Element*) override; | 76 bool runConstructor(Element*) override; |
| 75 Element* runConstructor(); | 77 Element* runConstructor(); |
| 76 | 78 |
| 77 void runCallback(v8::Local<v8::Function>, Element*, | 79 void runCallback(v8::Local<v8::Function>, Element*, |
| 78 int argc = 0, v8::Local<v8::Value> argv[] = nullptr); | 80 int argc = 0, v8::Local<v8::Value> argv[] = nullptr); |
| 79 | 81 |
| 80 RefPtr<ScriptState> m_scriptState; | 82 RefPtr<ScriptState> m_scriptState; |
| 81 ScopedPersistent<v8::Object> m_constructor; | 83 ScopedPersistent<v8::Object> m_constructor; |
| 82 ScopedPersistent<v8::Object> m_prototype; | 84 ScopedPersistent<v8::Object> m_prototype; |
| 83 ScopedPersistent<v8::Function> m_connectedCallback; | 85 ScopedPersistent<v8::Function> m_connectedCallback; |
| 84 ScopedPersistent<v8::Function> m_disconnectedCallback; | 86 ScopedPersistent<v8::Function> m_disconnectedCallback; |
| 85 ScopedPersistent<v8::Function> m_adoptedCallback; | 87 ScopedPersistent<v8::Function> m_adoptedCallback; |
| 86 ScopedPersistent<v8::Function> m_attributeChangedCallback; | 88 ScopedPersistent<v8::Function> m_attributeChangedCallback; |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 } // namespace blink | 91 } // namespace blink |
| 90 | 92 |
| 91 #endif // ScriptCustomElementDefinition_h | 93 #endif // ScriptCustomElementDefinition_h |
| OLD | NEW |