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

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

Issue 54283002: Rename |args| to |info| in V8 bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 static void TestTypedefsReplaceableAttributeSetter(v8::Local<v8::String> name, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 255 static void TestTypedefsReplaceableAttributeSetter(v8::Local<v8::String> name, v 8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
256 { 256 {
257 info.This()->ForceSet(name, jsValue); 257 info.This()->ForceSet(name, jsValue);
258 } 258 }
259 259
260 static void TestTypedefsReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 260 static void TestTypedefsReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
261 { 261 {
262 TestTypedefsV8Internal::TestTypedefsReplaceableAttributeSetter(name, jsValue , info); 262 TestTypedefsV8Internal::TestTypedefsReplaceableAttributeSetter(name, jsValue , info);
263 } 263 }
264 264
265 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 265 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
266 { 266 {
267 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 267 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
268 if (UNLIKELY(args.Length() <= 0)) { 268 if (UNLIKELY(info.Length() <= 0)) {
269 imp->func(); 269 imp->func();
270 return; 270 return;
271 } 271 }
272 V8TRYCATCH_VOID(Vector<int>, x, toNativeArray<int>(args[0], 1, args.GetIsola te())); 272 V8TRYCATCH_VOID(Vector<int>, x, toNativeArray<int>(info[0], 1, info.GetIsola te()));
273 imp->func(x); 273 imp->func(x);
274 } 274 }
275 275
276 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) 276 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
277 { 277 {
278 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 278 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
279 TestTypedefsV8Internal::funcMethod(args); 279 TestTypedefsV8Internal::funcMethod(info);
280 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 280 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
281 } 281 }
282 282
283 static void setShadowMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 283 static void setShadowMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
284 { 284 {
285 if (UNLIKELY(args.Length() < 3)) { 285 if (UNLIKELY(info.Length() < 3)) {
286 throwTypeError(ExceptionMessages::failedToExecute("setShadow", "TestType defs", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetIsolate ()); 286 throwTypeError(ExceptionMessages::failedToExecute("setShadow", "TestType defs", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate ());
287 return; 287 return;
288 } 288 }
289 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 289 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
290 V8TRYCATCH_VOID(float, width, static_cast<float>(args[0]->NumberValue())); 290 V8TRYCATCH_VOID(float, width, static_cast<float>(info[0]->NumberValue()));
291 V8TRYCATCH_VOID(float, height, static_cast<float>(args[1]->NumberValue())); 291 V8TRYCATCH_VOID(float, height, static_cast<float>(info[1]->NumberValue()));
292 V8TRYCATCH_VOID(float, blur, static_cast<float>(args[2]->NumberValue())); 292 V8TRYCATCH_VOID(float, blur, static_cast<float>(info[2]->NumberValue()));
293 if (UNLIKELY(args.Length() <= 3)) { 293 if (UNLIKELY(info.Length() <= 3)) {
294 imp->setShadow(width, height, blur); 294 imp->setShadow(width, height, blur);
295 return; 295 return;
296 } 296 }
297 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, color, args[3]); 297 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, color, info[3]);
298 if (UNLIKELY(args.Length() <= 4)) { 298 if (UNLIKELY(info.Length() <= 4)) {
299 imp->setShadow(width, height, blur, color); 299 imp->setShadow(width, height, blur, color);
300 return; 300 return;
301 } 301 }
302 V8TRYCATCH_VOID(float, alpha, static_cast<float>(args[4]->NumberValue())); 302 V8TRYCATCH_VOID(float, alpha, static_cast<float>(info[4]->NumberValue()));
303 imp->setShadow(width, height, blur, color, alpha); 303 imp->setShadow(width, height, blur, color, alpha);
304 } 304 }
305 305
306 static void setShadowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 306 static void setShadowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
307 { 307 {
308 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 308 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
309 TestTypedefsV8Internal::setShadowMethod(args); 309 TestTypedefsV8Internal::setShadowMethod(info);
310 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 310 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
311 } 311 }
312 312
313 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args) 313 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
314 { 314 {
315 if (UNLIKELY(args.Length() < 1)) { 315 if (UNLIKELY(info.Length() < 1)) {
316 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg ", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), arg s.GetIsolate()); 316 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg ", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate());
317 return; 317 return;
318 } 318 }
319 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 319 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
320 V8TRYCATCH_VOID(Vector<RefPtr<SerializedScriptValue> >, sequenceArg, (toRefP trNativeArray<SerializedScriptValue, V8SerializedScriptValue>(args[0], 1, args.G etIsolate()))); 320 V8TRYCATCH_VOID(Vector<RefPtr<SerializedScriptValue> >, sequenceArg, (toRefP trNativeArray<SerializedScriptValue, V8SerializedScriptValue>(info[0], 1, info.G etIsolate())));
321 v8SetReturnValue(args, static_cast<double>(imp->methodWithSequenceArg(sequen ceArg))); 321 v8SetReturnValue(info, static_cast<double>(imp->methodWithSequenceArg(sequen ceArg)));
322 } 322 }
323 323
324 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 324 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info)
325 { 325 {
326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
327 TestTypedefsV8Internal::methodWithSequenceArgMethod(args); 327 TestTypedefsV8Internal::methodWithSequenceArgMethod(info);
328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
329 } 329 }
330 330
331 static void nullableArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 331 static void nullableArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& in fo)
332 { 332 {
333 if (UNLIKELY(args.Length() < 1)) { 333 if (UNLIKELY(info.Length() < 1)) {
334 throwTypeError(ExceptionMessages::failedToExecute("nullableArrayArg", "T estTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate()); 334 throwTypeError(ExceptionMessages::failedToExecute("nullableArrayArg", "T estTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get Isolate());
335 return; 335 return;
336 } 336 }
337 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 337 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
338 bool arrayArgIsNull = args[0]->IsNull(); 338 bool arrayArgIsNull = info[0]->IsNull();
339 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], 1, args.GetIsolate())); 339 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
340 imp->nullableArrayArg(arrayArgIsNull ? 0 : &arrayArg); 340 imp->nullableArrayArg(arrayArgIsNull ? 0 : &arrayArg);
341 } 341 }
342 342
343 static void nullableArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args) 343 static void nullableArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
344 { 344 {
345 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 345 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
346 TestTypedefsV8Internal::nullableArrayArgMethod(args); 346 TestTypedefsV8Internal::nullableArrayArgMethod(info);
347 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 347 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
348 } 348 }
349 349
350 static void funcWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 350 static void funcWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
351 { 351 {
352 if (UNLIKELY(args.Length() < 1)) { 352 if (UNLIKELY(info.Length() < 1)) {
353 throwTypeError(ExceptionMessages::failedToExecute("funcWithClamp", "Test Typedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIso late()); 353 throwTypeError(ExceptionMessages::failedToExecute("funcWithClamp", "Test Typedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIso late());
354 return; 354 return;
355 } 355 }
356 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 356 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
357 unsigned long long arg1 = 0; 357 unsigned long long arg1 = 0;
358 V8TRYCATCH_VOID(double, arg1NativeValue, args[0]->NumberValue()); 358 V8TRYCATCH_VOID(double, arg1NativeValue, info[0]->NumberValue());
359 if (!std::isnan(arg1NativeValue)) 359 if (!std::isnan(arg1NativeValue))
360 arg1 = clampTo<unsigned long long>(arg1NativeValue); 360 arg1 = clampTo<unsigned long long>(arg1NativeValue);
361 if (UNLIKELY(args.Length() <= 1)) { 361 if (UNLIKELY(info.Length() <= 1)) {
362 imp->funcWithClamp(arg1); 362 imp->funcWithClamp(arg1);
363 return; 363 return;
364 } 364 }
365 unsigned long long arg2 = 0; 365 unsigned long long arg2 = 0;
366 V8TRYCATCH_VOID(double, arg2NativeValue, args[1]->NumberValue()); 366 V8TRYCATCH_VOID(double, arg2NativeValue, info[1]->NumberValue());
367 if (!std::isnan(arg2NativeValue)) 367 if (!std::isnan(arg2NativeValue))
368 arg2 = clampTo<unsigned long long>(arg2NativeValue); 368 arg2 = clampTo<unsigned long long>(arg2NativeValue);
369 imp->funcWithClamp(arg1, arg2); 369 imp->funcWithClamp(arg1, arg2);
370 } 370 }
371 371
372 static void funcWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value >& args) 372 static void funcWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value >& info)
373 { 373 {
374 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 374 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
375 TestTypedefsV8Internal::funcWithClampMethod(args); 375 TestTypedefsV8Internal::funcWithClampMethod(info);
376 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 376 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
377 } 377 }
378 378
379 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu e>& args) 379 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu e>& info)
380 { 380 {
381 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 381 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
382 v8SetReturnValue(args, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp- >immutablePointFunction()))); 382 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp- >immutablePointFunction())));
383 } 383 }
384 384
385 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& args) 385 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& info)
386 { 386 {
387 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 387 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
388 TestTypedefsV8Internal::immutablePointFunctionMethod(args); 388 TestTypedefsV8Internal::immutablePointFunctionMethod(info);
389 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 389 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
390 } 390 }
391 391
392 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 392 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
393 { 393 {
394 if (UNLIKELY(args.Length() < 1)) { 394 if (UNLIKELY(info.Length() < 1)) {
395 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate()); 395 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate());
396 return; 396 return;
397 } 397 }
398 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 398 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
399 ExceptionState es(args.GetIsolate()); 399 ExceptionState es(info.GetIsolate());
400 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], 1, ar gs.GetIsolate())); 400 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate()));
401 Vector<String> result = imp->stringArrayFunction(values, es); 401 Vector<String> result = imp->stringArrayFunction(values, es);
402 if (es.throwIfNeeded()) 402 if (es.throwIfNeeded())
403 return; 403 return;
404 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); 404 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
405 } 405 }
406 406
407 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args) 407 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
408 { 408 {
409 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 409 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
410 TestTypedefsV8Internal::stringArrayFunctionMethod(args); 410 TestTypedefsV8Internal::stringArrayFunctionMethod(info);
411 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 411 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
412 } 412 }
413 413
414 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & args) 414 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & info)
415 { 415 {
416 if (UNLIKELY(args.Length() < 1)) { 416 if (UNLIKELY(info.Length() < 1)) {
417 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2" , "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args .GetIsolate()); 417 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2" , "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info .GetIsolate());
418 return; 418 return;
419 } 419 }
420 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 420 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
421 ExceptionState es(args.GetIsolate()); 421 ExceptionState es(info.GetIsolate());
422 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], 1, ar gs.GetIsolate())); 422 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate()));
423 Vector<String> result = imp->stringArrayFunction2(values, es); 423 Vector<String> result = imp->stringArrayFunction2(values, es);
424 if (es.throwIfNeeded()) 424 if (es.throwIfNeeded())
425 return; 425 return;
426 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); 426 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
427 } 427 }
428 428
429 static void stringArrayFunction2MethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args) 429 static void stringArrayFunction2MethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info)
430 { 430 {
431 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 431 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
432 TestTypedefsV8Internal::stringArrayFunction2Method(args); 432 TestTypedefsV8Internal::stringArrayFunction2Method(info);
433 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 433 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
434 } 434 }
435 435
436 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 436 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
437 { 437 {
438 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 438 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
439 ExceptionState es(args.GetIsolate()); 439 ExceptionState es(info.GetIsolate());
440 imp->methodWithException(es); 440 imp->methodWithException(es);
441 if (es.throwIfNeeded()) 441 if (es.throwIfNeeded())
442 return; 442 return;
443 } 443 }
444 444
445 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args) 445 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
446 { 446 {
447 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 447 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
448 TestTypedefsV8Internal::methodWithExceptionMethod(args); 448 TestTypedefsV8Internal::methodWithExceptionMethod(info);
449 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 449 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
450 } 450 }
451 451
452 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) 452 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
453 { 453 {
454 if (UNLIKELY(args.Length() < 2)) { 454 if (UNLIKELY(info.Length() < 2)) {
455 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTy pedefs", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIsola te()); 455 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTy pedefs", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsola te());
456 return; 456 return;
457 } 457 }
458 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, hello, args[0]); 458 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, hello, info[0]);
459 if (args.Length() <= 1 || !args[1]->IsFunction()) { 459 if (info.Length() <= 1 || !info[1]->IsFunction()) {
460 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTy pedefs", "The callback provided as parameter 2 is not a function."), args.GetIso late()); 460 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTy pedefs", "The callback provided as parameter 2 is not a function."), info.GetIso late());
461 return; 461 return;
462 } 462 }
463 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[1], getExecu tionContext()); 463 RefPtr<TestCallback> testCallback = V8TestCallback::create(info[1], getExecu tionContext());
464 464
465 RefPtr<TestTypedefs> impl = TestTypedefs::create(hello, testCallback); 465 RefPtr<TestTypedefs> impl = TestTypedefs::create(hello, testCallback);
466 v8::Handle<v8::Object> wrapper = args.Holder(); 466 v8::Handle<v8::Object> wrapper = info.Holder();
467 467
468 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::wrapperTypeInfo, wrapper, args.GetIsolate(), WrapperConfiguration: :Dependent); 468 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration: :Dependent);
469 args.GetReturnValue().Set(wrapper); 469 info.GetReturnValue().Set(wrapper);
470 } 470 }
471 471
472 } // namespace TestTypedefsV8Internal 472 } // namespace TestTypedefsV8Internal
473 473
474 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = { 474 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes [] = {
475 {"unsignedLongLongAttr", TestTypedefsV8Internal::unsignedLongLongAttrAttribu teGetterCallback, TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetterCal lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro pertyAttribute>(v8::None), 0 /* on instance */}, 475 {"unsignedLongLongAttr", TestTypedefsV8Internal::unsignedLongLongAttrAttribu teGetterCallback, TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetterCal lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro pertyAttribute>(v8::None), 0 /* on instance */},
476 {"immutableSerializedScriptValue", TestTypedefsV8Internal::immutableSerializ edScriptValueAttributeGetterCallback, TestTypedefsV8Internal::immutableSerialize dScriptValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8: :DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 476 {"immutableSerializedScriptValue", TestTypedefsV8Internal::immutableSerializ edScriptValueAttributeGetterCallback, TestTypedefsV8Internal::immutableSerialize dScriptValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8: :DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
477 {"attrWithGetterException", TestTypedefsV8Internal::attrWithGetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithGetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 477 {"attrWithGetterException", TestTypedefsV8Internal::attrWithGetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithGetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
478 {"attrWithSetterException", TestTypedefsV8Internal::attrWithSetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithSetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 478 {"attrWithSetterException", TestTypedefsV8Internal::attrWithSetterExceptionA ttributeGetterCallback, TestTypedefsV8Internal::attrWithSetterExceptionAttribute SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
479 {"stringAttrWithGetterException", TestTypedefsV8Internal::stringAttrWithGett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithGetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 479 {"stringAttrWithGetterException", TestTypedefsV8Internal::stringAttrWithGett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithGetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
480 {"stringAttrWithSetterException", TestTypedefsV8Internal::stringAttrWithSett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithSetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 480 {"stringAttrWithSetterException", TestTypedefsV8Internal::stringAttrWithSett erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithSetter ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
481 }; 481 };
482 482
483 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = { 483 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = {
484 {"func", TestTypedefsV8Internal::funcMethodCallback, 0, 0}, 484 {"func", TestTypedefsV8Internal::funcMethodCallback, 0, 0},
485 {"setShadow", TestTypedefsV8Internal::setShadowMethodCallback, 0, 3}, 485 {"setShadow", TestTypedefsV8Internal::setShadowMethodCallback, 0, 3},
486 {"methodWithSequenceArg", TestTypedefsV8Internal::methodWithSequenceArgMetho dCallback, 0, 1}, 486 {"methodWithSequenceArg", TestTypedefsV8Internal::methodWithSequenceArgMetho dCallback, 0, 1},
487 {"nullableArrayArg", TestTypedefsV8Internal::nullableArrayArgMethodCallback, 0, 1}, 487 {"nullableArrayArg", TestTypedefsV8Internal::nullableArrayArgMethodCallback, 0, 1},
488 {"funcWithClamp", TestTypedefsV8Internal::funcWithClampMethodCallback, 0, 1} , 488 {"funcWithClamp", TestTypedefsV8Internal::funcWithClampMethodCallback, 0, 1} ,
489 {"immutablePointFunction", TestTypedefsV8Internal::immutablePointFunctionMet hodCallback, 0, 0}, 489 {"immutablePointFunction", TestTypedefsV8Internal::immutablePointFunctionMet hodCallback, 0, 0},
490 {"stringArrayFunction", TestTypedefsV8Internal::stringArrayFunctionMethodCal lback, 0, 1}, 490 {"stringArrayFunction", TestTypedefsV8Internal::stringArrayFunctionMethodCal lback, 0, 1},
491 {"stringArrayFunction2", TestTypedefsV8Internal::stringArrayFunction2MethodC allback, 0, 1}, 491 {"stringArrayFunction2", TestTypedefsV8Internal::stringArrayFunction2MethodC allback, 0, 1},
492 {"methodWithException", TestTypedefsV8Internal::methodWithExceptionMethodCal lback, 0, 0}, 492 {"methodWithException", TestTypedefsV8Internal::methodWithExceptionMethodCal lback, 0, 0},
493 }; 493 };
494 494
495 void V8TestTypedefs::constructorCallback(const v8::FunctionCallbackInfo<v8::Valu e>& args) 495 void V8TestTypedefs::constructorCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
496 { 496 {
497 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); 497 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
498 if (!args.IsConstructCall()) { 498 if (!info.IsConstructCall()) {
499 throwTypeError(ExceptionMessages::failedToConstruct("TestTypedefs", "Ple ase use the 'new' operator, this DOM object constructor cannot be called as a fu nction."), args.GetIsolate()); 499 throwTypeError(ExceptionMessages::failedToConstruct("TestTypedefs", "Ple ase use the 'new' operator, this DOM object constructor cannot be called as a fu nction."), info.GetIsolate());
500 return; 500 return;
501 } 501 }
502 502
503 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { 503 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
504 args.GetReturnValue().Set(args.Holder()); 504 info.GetReturnValue().Set(info.Holder());
505 return; 505 return;
506 } 506 }
507 507
508 TestTypedefsV8Internal::constructor(args); 508 TestTypedefsV8Internal::constructor(info);
509 } 509 }
510 510
511 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestTypedefsTemplate(v8::Hand le<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWor ldType) 511 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestTypedefsTemplate(v8::Hand le<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWor ldType)
512 { 512 {
513 desc->ReadOnlyPrototype(); 513 desc->ReadOnlyPrototype();
514 514
515 v8::Local<v8::Signature> defaultSignature; 515 v8::Local<v8::Signature> defaultSignature;
516 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestTy pedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internalFieldCount, 516 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestTy pedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internalFieldCount,
517 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), 517 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes),
518 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), 518 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods),
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &wrapperTypeI nfo, wrapper, isolate, WrapperConfiguration::Independent); 577 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &wrapperTypeI nfo, wrapper, isolate, WrapperConfiguration::Independent);
578 return wrapper; 578 return wrapper;
579 } 579 }
580 580
581 void V8TestTypedefs::derefObject(void* object) 581 void V8TestTypedefs::derefObject(void* object)
582 { 582 {
583 fromInternalPointer(object)->deref(); 583 fromInternalPointer(object)->deref();
584 } 584 }
585 585
586 } // namespace WebCore 586 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestOverloadedConstructors.cpp ('k') | Source/bindings/v8/CustomElementConstructorBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698