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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceNode.cpp

Issue 214143003: Bindings: use |holder| local variable in attribute getters and setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterfaceNode.h" 8 #include "V8TestInterfaceNode.h"
9 9
10 #include "HTMLNames.h" 10 #include "HTMLNames.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace WebCore { 43 namespace WebCore {
44 const WrapperTypeInfo V8TestInterfaceNode::wrapperTypeInfo = { gin::kEmbedderBli nk, V8TestInterfaceNode::domTemplate, V8TestInterfaceNode::derefObject, 0, V8Tes tInterfaceNode::toEventTarget, 0, V8TestInterfaceNode::installPerContextEnabledM ethods, &V8Node::wrapperTypeInfo, WrapperTypeObjectPrototype, false }; 44 const WrapperTypeInfo V8TestInterfaceNode::wrapperTypeInfo = { gin::kEmbedderBli nk, V8TestInterfaceNode::domTemplate, V8TestInterfaceNode::derefObject, 0, V8Tes tInterfaceNode::toEventTarget, 0, V8TestInterfaceNode::installPerContextEnabledM ethods, &V8Node::wrapperTypeInfo, WrapperTypeObjectPrototype, false };
45 45
46 namespace TestInterfaceNodeV8Internal { 46 namespace TestInterfaceNodeV8Internal {
47 47
48 template <typename T> void V8_USE(T) { } 48 template <typename T> void V8_USE(T) { }
49 49
50 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info) 50 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info)
51 { 51 {
52 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 52 v8::Handle<v8::Object> holder = info.Holder();
53 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
53 v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate()); 54 v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate());
54 } 55 }
55 56
56 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 57 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
57 { 58 {
58 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 59 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
59 TestInterfaceNodeV8Internal::stringAttributeAttributeGetter(info); 60 TestInterfaceNodeV8Internal::stringAttributeAttributeGetter(info);
60 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 61 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
61 } 62 }
62 63
63 static void stringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v 8::PropertyCallbackInfo<void>& info) 64 static void stringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v 8::PropertyCallbackInfo<void>& info)
64 { 65 {
65 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 66 v8::Handle<v8::Object> holder = info.Holder();
67 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
66 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 68 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
67 impl->setStringAttribute(cppValue); 69 impl->setStringAttribute(cppValue);
68 } 70 }
69 71
70 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 72 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
71 { 73 {
72 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 74 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
73 TestInterfaceNodeV8Internal::stringAttributeAttributeSetter(jsValue, info); 75 TestInterfaceNodeV8Internal::stringAttributeAttributeSetter(jsValue, info);
74 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 76 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
75 } 77 }
76 78
77 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info) 79 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info)
78 { 80 {
79 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 81 v8::Handle<v8::Object> holder = info.Holder();
82 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
80 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyTestInterfaceEmptyAttri bute()), impl); 83 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyTestInterfaceEmptyAttri bute()), impl);
81 } 84 }
82 85
83 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 86 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
84 { 87 {
85 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 88 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
86 TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGet ter(info); 89 TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGet ter(info);
87 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 90 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
88 } 91 }
89 92
90 static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo< v8::Value>& info) 93 static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo< v8::Value>& info)
91 { 94 {
92 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 95 v8::Handle<v8::Object> holder = info.Holder();
96 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
93 EventListener* jsValue = impl->eventHandlerAttribute(); 97 EventListener* jsValue = impl->eventHandlerAttribute();
94 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen er::cast(jsValue)->getListenerObject(impl->executionContext())) : v8::Handle<v8: :Value>(v8::Null(info.GetIsolate()))); 98 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen er::cast(jsValue)->getListenerObject(impl->executionContext())) : v8::Handle<v8: :Value>(v8::Null(info.GetIsolate())));
95 } 99 }
96 100
97 static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 101 static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
98 { 102 {
99 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 103 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
100 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info); 104 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info);
101 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 105 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
102 } 106 }
103 107
104 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> jsValue, c onst v8::PropertyCallbackInfo<void>& info) 108 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> jsValue, c onst v8::PropertyCallbackInfo<void>& info)
105 { 109 {
106 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 110 v8::Handle<v8::Object> holder = info.Holder();
111 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
107 impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(jsValue , true, ListenerFindOrCreate)); 112 impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(jsValue , true, ListenerFindOrCreate));
108 } 113 }
109 114
110 static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 115 static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
111 { 116 {
112 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
113 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeSetter(jsValue, i nfo); 118 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeSetter(jsValue, i nfo);
114 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
115 } 120 }
116 121
117 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(c onst v8::PropertyCallbackInfo<v8::Value>& info) 122 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(c onst v8::PropertyCallbackInfo<v8::Value>& info)
118 { 123 {
119 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 124 v8::Handle<v8::Object> holder = info.Holder();
125 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
120 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsReadonlyTestInt erfaceEmptyAttribute()), impl); 126 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsReadonlyTestInt erfaceEmptyAttribute()), impl);
121 } 127 }
122 128
123 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 129 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
124 { 130 {
125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 131 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
126 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri buteAttributeGetter(info); 132 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri buteAttributeGetter(info);
127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 133 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
128 } 134 }
129 135
130 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterFo rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 136 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterFo rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
131 { 137 {
132 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 138 v8::Handle<v8::Object> holder = info.Holder();
139 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
133 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsReadonl yTestInterfaceEmptyAttribute())); 140 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsReadonl yTestInterfaceEmptyAttribute()));
134 } 141 }
135 142
136 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val ue>& info) 143 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val ue>& info)
137 { 144 {
138 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
139 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri buteAttributeGetterForMainWorld(info); 146 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri buteAttributeGetterForMainWorld(info);
140 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
141 } 148 }
142 149
143 static void reflectStringAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info) 150 static void reflectStringAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info)
144 { 151 {
145 Element* impl = V8Element::toNative(info.Holder()); 152 v8::Handle<v8::Object> holder = info.Holder();
153 Element* impl = V8Element::toNative(holder);
146 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectstring attributeAttr), info.GetIsolate()); 154 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectstring attributeAttr), info.GetIsolate());
147 } 155 }
148 156
149 static void reflectStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 157 static void reflectStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
150 { 158 {
151 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 159 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
152 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeGetter(info); 160 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeGetter(info);
153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 161 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
154 } 162 }
155 163
156 static void reflectStringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 164 static void reflectStringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
157 { 165 {
158 Element* impl = V8Element::toNative(info.Holder()); 166 v8::Handle<v8::Object> holder = info.Holder();
167 Element* impl = V8Element::toNative(holder);
159 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 168 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
160 impl->setAttribute(HTMLNames::reflectstringattributeAttr, cppValue); 169 impl->setAttribute(HTMLNames::reflectstringattributeAttr, cppValue);
161 } 170 }
162 171
163 static void reflectStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 172 static void reflectStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
164 { 173 {
165 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
166 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 175 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
167 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeSetter(jsValue, info); 176 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeSetter(jsValue, info);
168 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 177 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
169 } 178 }
170 179
171 static void reflectUrlStringAttributeAttributeGetter(const v8::PropertyCallbackI nfo<v8::Value>& info) 180 static void reflectUrlStringAttributeAttributeGetter(const v8::PropertyCallbackI nfo<v8::Value>& info)
172 { 181 {
173 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(info.Holder()); 182 v8::Handle<v8::Object> holder = info.Holder();
183 TestInterfaceNode* impl = V8TestInterfaceNode::toNative(holder);
174 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflecturlstri ngattributeAttr), info.GetIsolate()); 184 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflecturlstri ngattributeAttr), info.GetIsolate());
175 } 185 }
176 186
177 static void reflectUrlStringAttributeAttributeGetterCallback(v8::Local<v8::Strin g>, const v8::PropertyCallbackInfo<v8::Value>& info) 187 static void reflectUrlStringAttributeAttributeGetterCallback(v8::Local<v8::Strin g>, const v8::PropertyCallbackInfo<v8::Value>& info)
178 { 188 {
179 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 189 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
180 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeGetter(info); 190 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeGetter(info);
181 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
182 } 192 }
183 193
184 static void reflectUrlStringAttributeAttributeSetter(v8::Local<v8::Value> jsValu e, const v8::PropertyCallbackInfo<void>& info) 194 static void reflectUrlStringAttributeAttributeSetter(v8::Local<v8::Value> jsValu e, const v8::PropertyCallbackInfo<void>& info)
185 { 195 {
186 Element* impl = V8Element::toNative(info.Holder()); 196 v8::Handle<v8::Object> holder = info.Holder();
197 Element* impl = V8Element::toNative(holder);
187 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 198 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
188 impl->setAttribute(HTMLNames::reflecturlstringattributeAttr, cppValue); 199 impl->setAttribute(HTMLNames::reflecturlstringattributeAttr, cppValue);
189 } 200 }
190 201
191 static void reflectUrlStringAttributeAttributeSetterCallback(v8::Local<v8::Strin g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 202 static void reflectUrlStringAttributeAttributeSetterCallback(v8::Local<v8::Strin g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
192 { 203 {
193 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 204 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
194 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 205 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
195 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(jsValu e, info); 206 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(jsValu e, info);
196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 207 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 fromInternalPointer(object)->deref(); 375 fromInternalPointer(object)->deref();
365 } 376 }
366 377
367 template<> 378 template<>
368 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec t> creationContext, v8::Isolate* isolate) 379 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec t> creationContext, v8::Isolate* isolate)
369 { 380 {
370 return toV8(impl, creationContext, isolate); 381 return toV8(impl, creationContext, isolate);
371 } 382 }
372 383
373 } // namespace WebCore 384 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698