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

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

Issue 202203009: Rename |imp| => |impl| in bindings generation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: custom/v8 too 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 static void implementsStaticStringAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in fo) 115 static void implementsStaticStringAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in fo)
116 { 116 {
117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
118 TestInterfaceV8Internal::implementsStaticStringAttributeAttributeSetter(jsVa lue, info); 118 TestInterfaceV8Internal::implementsStaticStringAttributeAttributeSetter(jsVa lue, info);
119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
120 } 120 }
121 121
122 static void implementsReadonlyStringAttributeAttributeGetter(const v8::PropertyC allbackInfo<v8::Value>& info) 122 static void implementsReadonlyStringAttributeAttributeGetter(const v8::PropertyC allbackInfo<v8::Value>& info)
123 { 123 {
124 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 124 TestInterface* impl = V8TestInterface::toNative(info.Holder());
125 ASSERT(imp); 125 ASSERT(impl);
126 v8SetReturnValueString(info, TestImplements::implementsReadonlyStringAttribu te(*imp), info.GetIsolate()); 126 v8SetReturnValueString(info, TestImplements::implementsReadonlyStringAttribu te(*impl), info.GetIsolate());
127 } 127 }
128 128
129 static void implementsReadonlyStringAttributeAttributeGetterCallback(v8::Local<v 8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 129 static void implementsReadonlyStringAttributeAttributeGetterCallback(v8::Local<v 8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
130 { 130 {
131 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 131 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
132 TestInterfaceV8Internal::implementsReadonlyStringAttributeAttributeGetter(in fo); 132 TestInterfaceV8Internal::implementsReadonlyStringAttributeAttributeGetter(in fo);
133 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 133 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
134 } 134 }
135 135
136 static void implementsStringAttributeAttributeGetter(const v8::PropertyCallbackI nfo<v8::Value>& info) 136 static void implementsStringAttributeAttributeGetter(const v8::PropertyCallbackI nfo<v8::Value>& info)
137 { 137 {
138 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 138 TestInterface* impl = V8TestInterface::toNative(info.Holder());
139 ASSERT(imp); 139 ASSERT(impl);
140 v8SetReturnValueString(info, TestImplements::implementsStringAttribute(*imp) , info.GetIsolate()); 140 v8SetReturnValueString(info, TestImplements::implementsStringAttribute(*impl ), info.GetIsolate());
141 } 141 }
142 142
143 static void implementsStringAttributeAttributeGetterCallback(v8::Local<v8::Strin g>, const v8::PropertyCallbackInfo<v8::Value>& info) 143 static void implementsStringAttributeAttributeGetterCallback(v8::Local<v8::Strin g>, const v8::PropertyCallbackInfo<v8::Value>& info)
144 { 144 {
145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
146 TestInterfaceV8Internal::implementsStringAttributeAttributeGetter(info); 146 TestInterfaceV8Internal::implementsStringAttributeAttributeGetter(info);
147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
148 } 148 }
149 149
150 static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> jsValu e, const v8::PropertyCallbackInfo<void>& info) 150 static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> jsValu e, const v8::PropertyCallbackInfo<void>& info)
151 { 151 {
152 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 152 TestInterface* impl = V8TestInterface::toNative(info.Holder());
153 ASSERT(imp); 153 ASSERT(impl);
154 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 154 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
155 TestImplements::setImplementsStringAttribute(*imp, cppValue); 155 TestImplements::setImplementsStringAttribute(*impl, cppValue);
156 } 156 }
157 157
158 static void implementsStringAttributeAttributeSetterCallback(v8::Local<v8::Strin g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 158 static void implementsStringAttributeAttributeSetterCallback(v8::Local<v8::Strin g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
159 { 159 {
160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
161 TestInterfaceV8Internal::implementsStringAttributeAttributeSetter(jsValue, i nfo); 161 TestInterfaceV8Internal::implementsStringAttributeAttributeSetter(jsValue, i nfo);
162 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 162 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
163 } 163 }
164 164
165 static void implementsNodeAttributeAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info) 165 static void implementsNodeAttributeAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info)
166 { 166 {
167 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 167 TestInterface* impl = V8TestInterface::toNative(info.Holder());
168 ASSERT(imp); 168 ASSERT(impl);
169 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsNodeAttribu te(*imp)), imp); 169 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsNodeAttribu te(*impl)), impl);
170 } 170 }
171 171
172 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 172 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
173 { 173 {
174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
175 TestInterfaceV8Internal::implementsNodeAttributeAttributeGetter(info); 175 TestInterfaceV8Internal::implementsNodeAttributeAttributeGetter(info);
176 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 176 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
177 } 177 }
178 178
179 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 179 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
180 { 180 {
181 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 181 TestInterface* impl = V8TestInterface::toNative(info.Holder());
182 ASSERT(imp); 182 ASSERT(impl);
183 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue)); 183 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue));
184 TestImplements::setImplementsNodeAttribute(*imp, WTF::getPtr(cppValue)); 184 TestImplements::setImplementsNodeAttribute(*impl, WTF::getPtr(cppValue));
185 } 185 }
186 186
187 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 187 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
188 { 188 {
189 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 189 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
190 TestInterfaceV8Internal::implementsNodeAttributeAttributeSetter(jsValue, inf o); 190 TestInterfaceV8Internal::implementsNodeAttributeAttributeSetter(jsValue, inf o);
191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
192 } 192 }
193 193
194 static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCal lbackInfo<v8::Value>& info) 194 static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCal lbackInfo<v8::Value>& info)
195 { 195 {
196 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 196 TestInterface* impl = V8TestInterface::toNative(info.Holder());
197 ASSERT(imp); 197 ASSERT(impl);
198 EventListener* jsValue = TestImplements::implementsEventHandlerAttribute(*im p); 198 EventListener* jsValue = TestImplements::implementsEventHandlerAttribute(*im pl);
199 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen er::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8:: Value>(v8::Null(info.GetIsolate()))); 199 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListen er::cast(jsValue)->getListenerObject(impl->executionContext())) : v8::Handle<v8: :Value>(v8::Null(info.GetIsolate())));
200 } 200 }
201 201
202 static void implementsEventHandlerAttributeAttributeGetterCallback(v8::Local<v8: :String>, const v8::PropertyCallbackInfo<v8::Value>& info) 202 static void implementsEventHandlerAttributeAttributeGetterCallback(v8::Local<v8: :String>, const v8::PropertyCallbackInfo<v8::Value>& info)
203 { 203 {
204 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 204 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
205 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeGetter(info ); 205 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeGetter(info );
206 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 206 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
207 } 207 }
208 208
209 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 209 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
210 { 210 {
211 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 211 TestInterface* impl = V8TestInterface::toNative(info.Holder());
212 ASSERT(imp); 212 ASSERT(impl);
213 moveEventListenerToNewWrapper(info.Holder(), TestImplements::implementsEvent HandlerAttribute(*imp), jsValue, V8TestInterface::eventListenerCacheIndex, info. GetIsolate()); 213 moveEventListenerToNewWrapper(info.Holder(), TestImplements::implementsEvent HandlerAttribute(*impl), jsValue, V8TestInterface::eventListenerCacheIndex, info .GetIsolate());
214 TestImplements::setImplementsEventHandlerAttribute(*imp, V8EventListenerList ::getEventListener(jsValue, true, ListenerFindOrCreate)); 214 TestImplements::setImplementsEventHandlerAttribute(*impl, V8EventListenerLis t::getEventListener(jsValue, true, ListenerFindOrCreate));
215 } 215 }
216 216
217 static void implementsEventHandlerAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in fo) 217 static void implementsEventHandlerAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in fo)
218 { 218 {
219 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 219 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
220 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeSetter(jsVa lue, info); 220 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeSetter(jsVa lue, info);
221 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 221 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
222 } 222 }
223 223
224 static void implementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::Prope rtyCallbackInfo<v8::Value>& info) 224 static void implementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::Prope rtyCallbackInfo<v8::Value>& info)
225 { 225 {
226 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 226 TestInterface* impl = V8TestInterface::toNative(info.Holder());
227 ASSERT(imp); 227 ASSERT(impl);
228 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsRuntimeEnab ledNodeAttribute(*imp)), imp); 228 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsRuntimeEnab ledNodeAttribute(*impl)), impl);
229 } 229 }
230 230
231 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Loc al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 231 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Loc al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
232 { 232 {
233 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 233 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
234 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGette r(info); 234 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGette r(info);
235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
236 } 236 }
237 237
238 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V alue> jsValue, const v8::PropertyCallbackInfo<void>& info) 238 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V alue> jsValue, const v8::PropertyCallbackInfo<void>& info)
239 { 239 {
240 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 240 TestInterface* impl = V8TestInterface::toNative(info.Holder());
241 ASSERT(imp); 241 ASSERT(impl);
242 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue)); 242 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue));
243 TestImplements::setImplementsRuntimeEnabledNodeAttribute(*imp, WTF::getPtr(c ppValue)); 243 TestImplements::setImplementsRuntimeEnabledNodeAttribute(*impl, WTF::getPtr( cppValue));
244 } 244 }
245 245
246 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi d>& info) 246 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc al<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<voi d>& info)
247 { 247 {
248 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 248 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
249 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSette r(jsValue, info); 249 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSette r(jsValue, info);
250 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 250 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
251 } 251 }
252 252
253 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::Pr opertyCallbackInfo<v8::Value>& info) 253 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::Pr opertyCallbackInfo<v8::Value>& info)
254 { 254 {
255 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 255 TestInterface* impl = V8TestInterface::toNative(info.Holder());
256 ASSERT(imp); 256 ASSERT(impl);
257 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsPerContextE nabledNodeAttribute(*imp)), imp); 257 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsPerContextE nabledNodeAttribute(*impl)), impl);
258 } 258 }
259 259
260 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8:: Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 260 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8:: Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
261 { 261 {
262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
263 TestInterfaceV8Internal::implementsPerContextEnabledNodeAttributeAttributeGe tter(info); 263 TestInterfaceV8Internal::implementsPerContextEnabledNodeAttributeAttributeGe tter(info);
264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
265 } 265 }
266 266
267 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8 ::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 267 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8 ::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
268 { 268 {
269 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 269 TestInterface* impl = V8TestInterface::toNative(info.Holder());
270 ASSERT(imp); 270 ASSERT(impl);
271 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue)); 271 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue));
272 TestImplements::setImplementsPerContextEnabledNodeAttribute(*imp, WTF::getPt r(cppValue)); 272 TestImplements::setImplementsPerContextEnabledNodeAttribute(*impl, WTF::getP tr(cppValue));
273 } 273 }
274 274
275 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8:: Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo< void>& info) 275 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8:: Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo< void>& info)
276 { 276 {
277 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 277 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
278 TestInterfaceV8Internal::implementsPerContextEnabledNodeAttributeAttributeSe tter(jsValue, info); 278 TestInterfaceV8Internal::implementsPerContextEnabledNodeAttributeAttributeSe tter(jsValue, info);
279 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 279 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
280 } 280 }
281 281
282 #if ENABLE(CONDITION_PARTIAL) 282 #if ENABLE(CONDITION_PARTIAL)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 { 324 {
325 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 325 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
326 TestInterfaceV8Internal::supplementalStaticAttrAttributeSetter(jsValue, info ); 326 TestInterfaceV8Internal::supplementalStaticAttrAttributeSetter(jsValue, info );
327 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 327 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
328 } 328 }
329 #endif // ENABLE(CONDITION_PARTIAL) 329 #endif // ENABLE(CONDITION_PARTIAL)
330 330
331 #if ENABLE(CONDITION_PARTIAL) 331 #if ENABLE(CONDITION_PARTIAL)
332 static void supplementalStr1AttributeGetter(const v8::PropertyCallbackInfo<v8::V alue>& info) 332 static void supplementalStr1AttributeGetter(const v8::PropertyCallbackInfo<v8::V alue>& info)
333 { 333 {
334 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 334 TestInterface* impl = V8TestInterface::toNative(info.Holder());
335 ASSERT(imp); 335 ASSERT(impl);
336 v8SetReturnValueString(info, TestPartialInterface::supplementalStr1(*imp), i nfo.GetIsolate()); 336 v8SetReturnValueString(info, TestPartialInterface::supplementalStr1(*impl), info.GetIsolate());
337 } 337 }
338 #endif // ENABLE(CONDITION_PARTIAL) 338 #endif // ENABLE(CONDITION_PARTIAL)
339 339
340 #if ENABLE(CONDITION_PARTIAL) 340 #if ENABLE(CONDITION_PARTIAL)
341 static void supplementalStr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 341 static void supplementalStr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
342 { 342 {
343 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 343 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
344 TestInterfaceV8Internal::supplementalStr1AttributeGetter(info); 344 TestInterfaceV8Internal::supplementalStr1AttributeGetter(info);
345 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 345 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
346 } 346 }
347 #endif // ENABLE(CONDITION_PARTIAL) 347 #endif // ENABLE(CONDITION_PARTIAL)
348 348
349 #if ENABLE(CONDITION_PARTIAL) 349 #if ENABLE(CONDITION_PARTIAL)
350 static void supplementalStr2AttributeGetter(const v8::PropertyCallbackInfo<v8::V alue>& info) 350 static void supplementalStr2AttributeGetter(const v8::PropertyCallbackInfo<v8::V alue>& info)
351 { 351 {
352 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 352 TestInterface* impl = V8TestInterface::toNative(info.Holder());
353 ASSERT(imp); 353 ASSERT(impl);
354 v8SetReturnValueString(info, TestPartialInterface::supplementalStr2(*imp), i nfo.GetIsolate()); 354 v8SetReturnValueString(info, TestPartialInterface::supplementalStr2(*impl), info.GetIsolate());
355 } 355 }
356 #endif // ENABLE(CONDITION_PARTIAL) 356 #endif // ENABLE(CONDITION_PARTIAL)
357 357
358 #if ENABLE(CONDITION_PARTIAL) 358 #if ENABLE(CONDITION_PARTIAL)
359 static void supplementalStr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 359 static void supplementalStr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
360 { 360 {
361 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 361 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
362 TestInterfaceV8Internal::supplementalStr2AttributeGetter(info); 362 TestInterfaceV8Internal::supplementalStr2AttributeGetter(info);
363 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 363 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
364 } 364 }
365 #endif // ENABLE(CONDITION_PARTIAL) 365 #endif // ENABLE(CONDITION_PARTIAL)
366 366
367 #if ENABLE(CONDITION_PARTIAL) 367 #if ENABLE(CONDITION_PARTIAL)
368 static void supplementalStr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 368 static void supplementalStr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
369 { 369 {
370 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 370 TestInterface* impl = V8TestInterface::toNative(info.Holder());
371 ASSERT(imp); 371 ASSERT(impl);
372 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 372 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
373 TestPartialInterface::setSupplementalStr2(*imp, cppValue); 373 TestPartialInterface::setSupplementalStr2(*impl, cppValue);
374 } 374 }
375 #endif // ENABLE(CONDITION_PARTIAL) 375 #endif // ENABLE(CONDITION_PARTIAL)
376 376
377 #if ENABLE(CONDITION_PARTIAL) 377 #if ENABLE(CONDITION_PARTIAL)
378 static void supplementalStr2AttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 378 static void supplementalStr2AttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
379 { 379 {
380 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 380 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
381 TestInterfaceV8Internal::supplementalStr2AttributeSetter(jsValue, info); 381 TestInterfaceV8Internal::supplementalStr2AttributeSetter(jsValue, info);
382 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 382 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
383 } 383 }
384 #endif // ENABLE(CONDITION_PARTIAL) 384 #endif // ENABLE(CONDITION_PARTIAL)
385 385
386 #if ENABLE(CONDITION_PARTIAL) 386 #if ENABLE(CONDITION_PARTIAL)
387 static void supplementalNodeAttributeGetter(const v8::PropertyCallbackInfo<v8::V alue>& info) 387 static void supplementalNodeAttributeGetter(const v8::PropertyCallbackInfo<v8::V alue>& info)
388 { 388 {
389 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 389 TestInterface* impl = V8TestInterface::toNative(info.Holder());
390 ASSERT(imp); 390 ASSERT(impl);
391 v8SetReturnValueFast(info, WTF::getPtr(TestPartialInterface::supplementalNod e(*imp)), imp); 391 v8SetReturnValueFast(info, WTF::getPtr(TestPartialInterface::supplementalNod e(*impl)), impl);
392 } 392 }
393 #endif // ENABLE(CONDITION_PARTIAL) 393 #endif // ENABLE(CONDITION_PARTIAL)
394 394
395 #if ENABLE(CONDITION_PARTIAL) 395 #if ENABLE(CONDITION_PARTIAL)
396 static void supplementalNodeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 396 static void supplementalNodeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
397 { 397 {
398 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 398 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
399 TestInterfaceV8Internal::supplementalNodeAttributeGetter(info); 399 TestInterfaceV8Internal::supplementalNodeAttributeGetter(info);
400 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 400 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
401 } 401 }
402 #endif // ENABLE(CONDITION_PARTIAL) 402 #endif // ENABLE(CONDITION_PARTIAL)
403 403
404 #if ENABLE(CONDITION_PARTIAL) 404 #if ENABLE(CONDITION_PARTIAL)
405 static void supplementalNodeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 405 static void supplementalNodeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
406 { 406 {
407 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 407 TestInterface* impl = V8TestInterface::toNative(info.Holder());
408 ASSERT(imp); 408 ASSERT(impl);
409 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue)); 409 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue));
410 TestPartialInterface::setSupplementalNode(*imp, WTF::getPtr(cppValue)); 410 TestPartialInterface::setSupplementalNode(*impl, WTF::getPtr(cppValue));
411 } 411 }
412 #endif // ENABLE(CONDITION_PARTIAL) 412 #endif // ENABLE(CONDITION_PARTIAL)
413 413
414 #if ENABLE(CONDITION_PARTIAL) 414 #if ENABLE(CONDITION_PARTIAL)
415 static void supplementalNodeAttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 415 static void supplementalNodeAttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
416 { 416 {
417 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 417 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
418 TestInterfaceV8Internal::supplementalNodeAttributeSetter(jsValue, info); 418 TestInterfaceV8Internal::supplementalNodeAttributeSetter(jsValue, info);
419 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 419 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
420 } 420 }
421 #endif // ENABLE(CONDITION_PARTIAL) 421 #endif // ENABLE(CONDITION_PARTIAL)
422 422
423 #if ENABLE(CONDITION_PARTIAL) 423 #if ENABLE(CONDITION_PARTIAL)
424 static void Node13AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& inf o) 424 static void Node13AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& inf o)
425 { 425 {
426 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 426 TestInterface* impl = V8TestInterface::toNative(info.Holder());
427 ASSERT(imp); 427 ASSERT(impl);
428 v8SetReturnValueFast(info, WTF::getPtr(TestPartialInterface::node13(*imp)), imp); 428 v8SetReturnValueFast(info, WTF::getPtr(TestPartialInterface::node13(*impl)), impl);
429 } 429 }
430 #endif // ENABLE(CONDITION_PARTIAL) 430 #endif // ENABLE(CONDITION_PARTIAL)
431 431
432 #if ENABLE(CONDITION_PARTIAL) 432 #if ENABLE(CONDITION_PARTIAL)
433 static void Node13AttributeGetterCallback(v8::Local<v8::String>, const v8::Prope rtyCallbackInfo<v8::Value>& info) 433 static void Node13AttributeGetterCallback(v8::Local<v8::String>, const v8::Prope rtyCallbackInfo<v8::Value>& info)
434 { 434 {
435 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 435 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
436 TestInterfaceV8Internal::Node13AttributeGetter(info); 436 TestInterfaceV8Internal::Node13AttributeGetter(info);
437 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 437 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
438 } 438 }
439 #endif // ENABLE(CONDITION_PARTIAL) 439 #endif // ENABLE(CONDITION_PARTIAL)
440 440
441 #if ENABLE(CONDITION_PARTIAL) 441 #if ENABLE(CONDITION_PARTIAL)
442 static void Node13AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper tyCallbackInfo<void>& info) 442 static void Node13AttributeSetter(v8::Local<v8::Value> jsValue, const v8::Proper tyCallbackInfo<void>& info)
443 { 443 {
444 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 444 TestInterface* impl = V8TestInterface::toNative(info.Holder());
445 ASSERT(imp); 445 ASSERT(impl);
446 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue)); 446 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola te(), jsValue));
447 TestPartialInterface::setNode13(*imp, WTF::getPtr(cppValue)); 447 TestPartialInterface::setNode13(*impl, WTF::getPtr(cppValue));
448 } 448 }
449 #endif // ENABLE(CONDITION_PARTIAL) 449 #endif // ENABLE(CONDITION_PARTIAL)
450 450
451 #if ENABLE(CONDITION_PARTIAL) 451 #if ENABLE(CONDITION_PARTIAL)
452 static void Node13AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V alue> jsValue, const v8::PropertyCallbackInfo<void>& info) 452 static void Node13AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V alue> jsValue, const v8::PropertyCallbackInfo<void>& info)
453 { 453 {
454 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 454 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
455 TestInterfaceV8Internal::Node13AttributeSetter(jsValue, info); 455 TestInterfaceV8Internal::Node13AttributeSetter(jsValue, info);
456 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 456 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
457 } 457 }
458 #endif // ENABLE(CONDITION_PARTIAL) 458 #endif // ENABLE(CONDITION_PARTIAL)
459 459
460 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 460 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
461 { 461 {
462 if (UNLIKELY(info.Length() < 1)) { 462 if (UNLIKELY(info.Length() < 1)) {
463 throwTypeError(ExceptionMessages::failedToExecute("namedItem", "TestInte rface", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolat e()); 463 throwTypeError(ExceptionMessages::failedToExecute("namedItem", "TestInte rface", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolat e());
464 return; 464 return;
465 } 465 }
466 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 466 TestInterface* impl = V8TestInterface::toNative(info.Holder());
467 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); 467 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
468 bool result0Enabled = false; 468 bool result0Enabled = false;
469 RefPtr<Node> result0; 469 RefPtr<Node> result0;
470 bool result1Enabled = false; 470 bool result1Enabled = false;
471 RefPtr<NodeList> result1; 471 RefPtr<NodeList> result1;
472 imp->getItem(name, result0Enabled, result0, result1Enabled, result1); 472 impl->getItem(name, result0Enabled, result0, result1Enabled, result1);
473 if (result0Enabled) { 473 if (result0Enabled) {
474 v8SetReturnValue(info, result0.release()); 474 v8SetReturnValue(info, result0.release());
475 return; 475 return;
476 } 476 }
477 if (result1Enabled) { 477 if (result1Enabled) {
478 v8SetReturnValue(info, result1.release()); 478 v8SetReturnValue(info, result1.release());
479 return; 479 return;
480 } 480 }
481 v8SetReturnValueNull(info); 481 v8SetReturnValueNull(info);
482 } 482 }
483 483
484 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 484 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
485 { 485 {
486 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 486 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
487 TestInterfaceV8Internal::namedItemMethod(info); 487 TestInterfaceV8Internal::namedItemMethod(info);
488 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 488 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
489 } 489 }
490 490
491 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info) 491 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)
492 { 492 {
493 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 493 TestInterface* impl = V8TestInterface::toNative(info.Holder());
494 ASSERT(imp); 494 ASSERT(impl);
495 TestImplements::implementsVoidMethod(*imp); 495 TestImplements::implementsVoidMethod(*impl);
496 } 496 }
497 497
498 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info) 498 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info)
499 { 499 {
500 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 500 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
501 TestInterfaceV8Internal::implementsVoidMethodMethod(info); 501 TestInterfaceV8Internal::implementsVoidMethodMethod(info);
502 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 502 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
503 } 503 }
504 504
505 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info) 505 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info)
506 { 506 {
507 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); 507 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC omplexMethod", "TestInterface", info.Holder(), info.GetIsolate());
508 if (UNLIKELY(info.Length() < 2)) { 508 if (UNLIKELY(info.Length() < 2)) {
509 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 509 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
510 exceptionState.throwIfNeeded(); 510 exceptionState.throwIfNeeded();
511 return; 511 return;
512 } 512 }
513 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 513 TestInterface* impl = V8TestInterface::toNative(info.Holder());
514 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); 514 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
515 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::toNativeWithTypeCheck(info.GetIsolate(), info[1])); 515 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
516 ASSERT(imp); 516 ASSERT(impl);
517 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()) ; 517 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()) ;
518 RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod( scriptContext, *imp, strArg, testInterfaceEmptyArg, exceptionState); 518 RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod( scriptContext, *impl, strArg, testInterfaceEmptyArg, exceptionState);
519 if (exceptionState.throwIfNeeded()) 519 if (exceptionState.throwIfNeeded())
520 return; 520 return;
521 v8SetReturnValue(info, result.release()); 521 v8SetReturnValue(info, result.release());
522 } 522 }
523 523
524 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& info) 524 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& info)
525 { 525 {
526 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 526 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
527 TestInterfaceV8Internal::implementsComplexMethodMethod(info); 527 TestInterfaceV8Internal::implementsComplexMethodMethod(info);
528 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 528 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
(...skipping 14 matching lines...) Expand all
543 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info) 543 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info)
544 { 544 {
545 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 545 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
546 TestInterfaceV8Internal::implementsStaticVoidMethodMethod(info); 546 TestInterfaceV8Internal::implementsStaticVoidMethodMethod(info);
547 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 547 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
548 } 548 }
549 549
550 #if ENABLE(CONDITION_PARTIAL) 550 #if ENABLE(CONDITION_PARTIAL)
551 static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 551 static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
552 { 552 {
553 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 553 TestInterface* impl = V8TestInterface::toNative(info.Holder());
554 ASSERT(imp); 554 ASSERT(impl);
555 TestPartialInterface::supplementalMethod1(*imp); 555 TestPartialInterface::supplementalMethod1(*impl);
556 } 556 }
557 #endif // ENABLE(CONDITION_PARTIAL) 557 #endif // ENABLE(CONDITION_PARTIAL)
558 558
559 #if ENABLE(CONDITION_PARTIAL) 559 #if ENABLE(CONDITION_PARTIAL)
560 static void supplementalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 560 static void supplementalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
561 { 561 {
562 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 562 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
563 TestInterfaceV8Internal::supplementalMethod1Method(info); 563 TestInterfaceV8Internal::supplementalMethod1Method(info);
564 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 564 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
565 } 565 }
566 #endif // ENABLE(CONDITION_PARTIAL) 566 #endif // ENABLE(CONDITION_PARTIAL)
567 567
568 #if ENABLE(CONDITION_PARTIAL) 568 #if ENABLE(CONDITION_PARTIAL)
569 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 569 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
570 { 570 {
571 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa lMethod2", "TestInterface", info.Holder(), info.GetIsolate()); 571 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa lMethod2", "TestInterface", info.Holder(), info.GetIsolate());
572 if (UNLIKELY(info.Length() < 2)) { 572 if (UNLIKELY(info.Length() < 2)) {
573 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 573 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
574 exceptionState.throwIfNeeded(); 574 exceptionState.throwIfNeeded();
575 return; 575 return;
576 } 576 }
577 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 577 TestInterface* impl = V8TestInterface::toNative(info.Holder());
578 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); 578 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
579 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(inf o.GetIsolate(), info[1])); 579 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(inf o.GetIsolate(), info[1]));
580 ASSERT(imp); 580 ASSERT(impl);
581 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()) ; 581 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()) ;
582 RefPtr<TestObject> result = TestPartialInterface::supplementalMethod2(script Context, *imp, strArg, objArg, exceptionState); 582 RefPtr<TestObject> result = TestPartialInterface::supplementalMethod2(script Context, *impl, strArg, objArg, exceptionState);
583 if (exceptionState.throwIfNeeded()) 583 if (exceptionState.throwIfNeeded())
584 return; 584 return;
585 v8SetReturnValue(info, result.release()); 585 v8SetReturnValue(info, result.release());
586 } 586 }
587 #endif // ENABLE(CONDITION_PARTIAL) 587 #endif // ENABLE(CONDITION_PARTIAL)
588 588
589 #if ENABLE(CONDITION_PARTIAL) 589 #if ENABLE(CONDITION_PARTIAL)
590 static void supplementalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 590 static void supplementalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
591 { 591 {
592 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 592 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 v8SetReturnValue(info, wrapper); 640 v8SetReturnValue(info, wrapper);
641 } 641 }
642 642
643 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info) 643 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info)
644 { 644 {
645 if (info.Holder()->HasRealNamedProperty(name)) 645 if (info.Holder()->HasRealNamedProperty(name))
646 return; 646 return;
647 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 647 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
648 return; 648 return;
649 649
650 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 650 TestInterface* impl = V8TestInterface::toNative(info.Holder());
651 AtomicString propertyName = toCoreAtomicString(name); 651 AtomicString propertyName = toCoreAtomicString(name);
652 bool result0Enabled = false; 652 bool result0Enabled = false;
653 RefPtr<Node> result0; 653 RefPtr<Node> result0;
654 bool result1Enabled = false; 654 bool result1Enabled = false;
655 RefPtr<NodeList> result1; 655 RefPtr<NodeList> result1;
656 imp->getItem(propertyName, result0Enabled, result0, result1Enabled, result1) ; 656 impl->getItem(propertyName, result0Enabled, result0, result1Enabled, result1 );
657 if (!result0Enabled && !result1Enabled) 657 if (!result0Enabled && !result1Enabled)
658 return; 658 return;
659 if (result0Enabled) { 659 if (result0Enabled) {
660 v8SetReturnValueFast(info, WTF::getPtr(result0.release()), imp); 660 v8SetReturnValueFast(info, WTF::getPtr(result0.release()), impl);
661 return; 661 return;
662 } 662 }
663 if (result1Enabled) { 663 if (result1Enabled) {
664 v8SetReturnValueFast(info, WTF::getPtr(result1.release()), imp); 664 v8SetReturnValueFast(info, WTF::getPtr(result1.release()), impl);
665 return; 665 return;
666 } 666 }
667 v8SetReturnValueNull(info); 667 v8SetReturnValueNull(info);
668 } 668 }
669 669
670 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info) 670 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
671 { 671 {
672 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 672 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
673 TestInterfaceV8Internal::namedPropertyGetter(name, info); 673 TestInterfaceV8Internal::namedPropertyGetter(name, info);
674 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 674 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
675 } 675 }
676 676
677 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8 ::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) 677 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8 ::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
678 { 678 {
679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
680 V8TestInterface::namedPropertySetterCustom(name, jsValue, info); 680 V8TestInterface::namedPropertySetterCustom(name, jsValue, info);
681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
682 } 682 }
683 683
684 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info) 684 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info)
685 { 685 {
686 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 686 TestInterface* impl = V8TestInterface::toNative(info.Holder());
687 AtomicString propertyName = toCoreAtomicString(name); 687 AtomicString propertyName = toCoreAtomicString(name);
688 v8::String::Utf8Value namedProperty(name); 688 v8::String::Utf8Value namedProperty(name);
689 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface", info.Holder(), info.GetIsolate()); 689 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface", info.Holder(), info.GetIsolate());
690 bool result = imp->namedPropertyQuery(propertyName, exceptionState); 690 bool result = impl->namedPropertyQuery(propertyName, exceptionState);
691 if (exceptionState.throwIfNeeded()) 691 if (exceptionState.throwIfNeeded())
692 return; 692 return;
693 if (!result) 693 if (!result)
694 return; 694 return;
695 v8SetReturnValueInt(info, v8::None); 695 v8SetReturnValueInt(info, v8::None);
696 } 696 }
697 697
698 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info) 698 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info)
699 { 699 {
700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
701 TestInterfaceV8Internal::namedPropertyQuery(name, info); 701 TestInterfaceV8Internal::namedPropertyQuery(name, info);
702 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 702 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
703 } 703 }
704 704
705 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 705 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
706 { 706 {
707 TestInterface* imp = V8TestInterface::toNative(info.Holder()); 707 TestInterface* impl = V8TestInterface::toNative(info.Holder());
708 Vector<String> names; 708 Vector<String> names;
709 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face", info.Holder(), info.GetIsolate()); 709 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face", info.Holder(), info.GetIsolate());
710 imp->namedPropertyEnumerator(names, exceptionState); 710 impl->namedPropertyEnumerator(names, exceptionState);
711 if (exceptionState.throwIfNeeded()) 711 if (exceptionState.throwIfNeeded())
712 return; 712 return;
713 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ()); 713 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ());
714 for (size_t i = 0; i < names.size(); ++i) 714 for (size_t i = 0; i < names.size(); ++i)
715 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i])); 715 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i]));
716 v8SetReturnValue(info, v8names); 716 v8SetReturnValue(info, v8names);
717 } 717 }
718 718
719 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 719 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
720 { 720 {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 } 912 }
913 913
914 template<> 914 template<>
915 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 915 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
916 { 916 {
917 return toV8(impl, creationContext, isolate); 917 return toV8(impl, creationContext, isolate);
918 } 918 }
919 919
920 } // namespace WebCore 920 } // namespace WebCore
921 #endif // ENABLE(Condition1) || ENABLE(Condition2) 921 #endif // ENABLE(Condition1) || ENABLE(Condition2)
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestException.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceCheckSecurity.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698