Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h

Issue 2170383002: CustomElements: adopt node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch update Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
28 const v8::Local<v8::Value>& constructor); 28 const v8::Local<v8::Value>& constructor);
29 29
30 static ScriptCustomElementDefinition* create( 30 static ScriptCustomElementDefinition* create(
31 ScriptState*, 31 ScriptState*,
32 CustomElementsRegistry*, 32 CustomElementsRegistry*,
33 const CustomElementDescriptor&, 33 const CustomElementDescriptor&,
34 const v8::Local<v8::Object>& constructor, 34 const v8::Local<v8::Object>& constructor,
35 const v8::Local<v8::Object>& prototype, 35 const v8::Local<v8::Object>& prototype,
36 const v8::Local<v8::Function>& connectedCallback, 36 const v8::Local<v8::Function>& connectedCallback,
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>& attributeChangedCallback, 39 const v8::Local<v8::Function>& attributeChangedCallback,
39 const HashSet<AtomicString>& observedAttributes); 40 const HashSet<AtomicString>& observedAttributes);
40 41
41 virtual ~ScriptCustomElementDefinition() = default; 42 virtual ~ScriptCustomElementDefinition() = default;
42 43
43 v8::Local<v8::Object> constructor() const; 44 v8::Local<v8::Object> constructor() const;
44 v8::Local<v8::Object> prototype() const; 45 v8::Local<v8::Object> prototype() const;
45 46
46 HTMLElement* createElementSync(Document&, const QualifiedName&) override; 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;
48 49
50 void fireErrorEvent(
51 ScriptState*,
52 const String& message,
53 v8::Local<v8::Value> exception,
54 std::unique_ptr<SourceLocation>);
55
49 bool hasConnectedCallback() const override; 56 bool hasConnectedCallback() const override;
50 bool hasDisconnectedCallback() const override; 57 bool hasDisconnectedCallback() const override;
58 bool hasAdoptedCallback() const override;
51 59
52 void runConnectedCallback(Element*) override; 60 void runConnectedCallback(Element*) override;
53 void runDisconnectedCallback(Element*) override; 61 void runDisconnectedCallback(Element*) override;
62 void runAdoptedCallback(Element*) override;
54 void runAttributeChangedCallback(Element*, const QualifiedName&, 63 void runAttributeChangedCallback(Element*, const QualifiedName&,
55 const AtomicString& oldValue, const AtomicString& newValue) override; 64 const AtomicString& oldValue, const AtomicString& newValue) override;
56 65
57 private: 66 private:
58 ScriptCustomElementDefinition( 67 ScriptCustomElementDefinition(
59 ScriptState*, 68 ScriptState*,
60 const CustomElementDescriptor&, 69 const CustomElementDescriptor&,
61 const v8::Local<v8::Object>& constructor, 70 const v8::Local<v8::Object>& constructor,
62 const v8::Local<v8::Object>& prototype, 71 const v8::Local<v8::Object>& prototype,
63 const v8::Local<v8::Function>& connectedCallback, 72 const v8::Local<v8::Function>& connectedCallback,
64 const v8::Local<v8::Function>& disconnectedCallback, 73 const v8::Local<v8::Function>& disconnectedCallback,
74 const v8::Local<v8::Function>& adoptedCallback,
65 const v8::Local<v8::Function>& attributeChangedCallback, 75 const v8::Local<v8::Function>& attributeChangedCallback,
66 const HashSet<AtomicString>& observedAttributes); 76 const HashSet<AtomicString>& observedAttributes);
67 77
68 // Implementations of |CustomElementDefinition| 78 // Implementations of |CustomElementDefinition|
69 ScriptValue getConstructorForScript() final; 79 ScriptValue getConstructorForScript() final;
70 bool runConstructor(Element*) override; 80 bool runConstructor(Element*) override;
71 Element* runConstructor(); 81 Element* runConstructor();
72 82
73 void runCallback(v8::Local<v8::Function>, Element*, 83 void runCallback(v8::Local<v8::Function>, Element*,
74 int argc = 0, v8::Local<v8::Value> argv[] = nullptr); 84 int argc = 0, v8::Local<v8::Value> argv[] = nullptr);
75 85
76 RefPtr<ScriptState> m_scriptState; 86 RefPtr<ScriptState> m_scriptState;
77 ScopedPersistent<v8::Object> m_constructor; 87 ScopedPersistent<v8::Object> m_constructor;
78 ScopedPersistent<v8::Object> m_prototype; 88 ScopedPersistent<v8::Object> m_prototype;
79 ScopedPersistent<v8::Function> m_connectedCallback; 89 ScopedPersistent<v8::Function> m_connectedCallback;
80 ScopedPersistent<v8::Function> m_disconnectedCallback; 90 ScopedPersistent<v8::Function> m_disconnectedCallback;
91 ScopedPersistent<v8::Function> m_adoptedCallback;
81 ScopedPersistent<v8::Function> m_attributeChangedCallback; 92 ScopedPersistent<v8::Function> m_attributeChangedCallback;
82 }; 93 };
83 94
84 } // namespace blink 95 } // namespace blink
85 96
86 #endif // ScriptCustomElementDefinition_h 97 #endif // ScriptCustomElementDefinition_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698