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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 2301993002: binding: Introduces ExceptionToPromiseScope. (Closed)
Patch Set: Addressed review comments (rename, empty line). Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 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 "V8TestInterface5.h" 7 #include "V8TestInterface5.h"
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/GeneratedCodeHelper.h" 10 #include "bindings/core/v8/GeneratedCodeHelper.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 308 }
309 309
310 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info) 310 void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCallbackInf o<v8::Value>& info)
311 { 311 {
312 v8::Local<v8::Value> v8Value = info[0]; 312 v8::Local<v8::Value> v8Value = info[0];
313 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette r(v8Value, info); 313 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSette r(v8Value, info);
314 } 314 }
315 315
316 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 316 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
317 { 317 {
318 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
319
318 if (UNLIKELY(info.Length() < 1)) { 320 if (UNLIKELY(info.Length() < 1)) {
319 V8ThrowException::throwException(info.GetIsolate(), V8ThrowException::cr eateTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodT estInterfaceEmptyArg", "TestInterface5", ExceptionMessages::notEnoughArguments(1 , info.Length())))); 321 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMes sages::notEnoughArguments(1, info.Length())));
320 return; 322 return;
321 } 323 }
322 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 324
323 TestInterfaceEmpty* testInterfaceEmptyArg; 325 TestInterfaceEmpty* testInterfaceEmptyArg;
324 { 326 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIs olate(), info[0]);
325 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]); 327 if (!testInterfaceEmptyArg) {
326 if (!testInterfaceEmptyArg) { 328 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f ailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is not of type 'TestInterfaceEmpty'."));
327 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage s::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "paramet er 1 is not of type 'TestInterfaceEmpty'.")); 329
328 return; 330 return;
329 }
330 } 331 }
332
331 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 333 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
332 } 334 }
333 335
334 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 336 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
335 { 337 {
336 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMetho d(info); 338 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMetho d(info);
337 } 339 }
338 340
339 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) 341 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info)
340 { 342 {
341 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD oubleArgFloatArg", "TestInterface5", info.Holder(), info.GetIsolate()); 343 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "voidMethodDoubleArgFloatArg");
344
345 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
346
342 if (UNLIKELY(info.Length() < 2)) { 347 if (UNLIKELY(info.Length() < 2)) {
343 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 348 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
344 return; 349 return;
345 } 350 }
346 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 351
347 double doubleArg; 352 double doubleArg;
348 float floatArg; 353 float floatArg;
349 { 354 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
350 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionStat e); 355 if (exceptionState.hadException())
351 if (exceptionState.hadException()) 356 return;
352 return; 357
353 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState) ; 358 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState);
354 if (exceptionState.hadException()) 359 if (exceptionState.hadException())
355 return; 360 return;
356 } 361
357 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); 362 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg);
358 } 363 }
359 364
360 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info) 365 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info)
361 { 366 {
362 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(in fo); 367 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(in fo);
363 } 368 }
364 369
365 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info) 370 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info)
366 { 371 {
367 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodU nrestrictedDoubleArgUnrestrictedFloatArg", "TestInterface5", info.Holder(), info .GetIsolate()); 372 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg");
373
374 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
375
368 if (UNLIKELY(info.Length() < 2)) { 376 if (UNLIKELY(info.Length() < 2)) {
369 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 377 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
370 return; 378 return;
371 } 379 }
372 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 380
373 double unrestrictedDoubleArg; 381 double unrestrictedDoubleArg;
374 float unrestrictedFloatArg; 382 float unrestrictedFloatArg;
375 { 383 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState) ;
376 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionSt ate); 384 if (exceptionState.hadException())
377 if (exceptionState.hadException()) 385 return;
378 return; 386
379 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionStat e); 387 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState);
380 if (exceptionState.hadException()) 388 if (exceptionState.hadException())
381 return; 389 return;
382 } 390
383 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDouble Arg, unrestrictedFloatArg); 391 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDouble Arg, unrestrictedFloatArg);
384 } 392 }
385 393
386 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info) 394 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info)
387 { 395 {
388 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnres trictedFloatArgMethod(info); 396 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnres trictedFloatArgMethod(info);
389 } 397 }
390 398
391 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 399 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
392 { 400 {
393 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 401 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
402
394 impl->voidMethod(); 403 impl->voidMethod();
395 } 404 }
396 405
397 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 406 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
398 { 407 {
399 TestInterface5ImplementationV8Internal::voidMethodMethod(info); 408 TestInterface5ImplementationV8Internal::voidMethodMethod(info);
400 } 409 }
401 410
402 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu e>& info) 411 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu e>& info)
403 { 412 {
404 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 413 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
414
405 impl->voidMethod(); 415 impl->voidMethod();
406 } 416 }
407 417
408 static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo< v8::Value>& info) 418 static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo< v8::Value>& info)
409 { 419 {
410 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info); 420 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info);
411 } 421 }
412 422
413 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 423 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
414 { 424 {
415 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 425 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
426
416 impl->alwaysExposedMethod(); 427 impl->alwaysExposedMethod();
417 } 428 }
418 429
419 static void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 430 static void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
420 { 431 {
421 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info); 432 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info);
422 } 433 }
423 434
424 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 435 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
425 { 436 {
426 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 437 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
438
427 impl->workerExposedMethod(); 439 impl->workerExposedMethod();
428 } 440 }
429 441
430 static void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 442 static void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
431 { 443 {
432 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info); 444 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info);
433 } 445 }
434 446
435 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 447 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
436 { 448 {
437 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 449 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
450
438 impl->windowExposedMethod(); 451 impl->windowExposedMethod();
439 } 452 }
440 453
441 static void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 454 static void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
442 { 455 {
443 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info); 456 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info);
444 } 457 }
445 458
446 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) 459 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info)
447 { 460 {
(...skipping 21 matching lines...) Expand all
469 } 482 }
470 483
471 static void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info) 484 static void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info)
472 { 485 {
473 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info ); 486 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info );
474 } 487 }
475 488
476 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback Info<v8::Value>& info) 489 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback Info<v8::Value>& info)
477 { 490 {
478 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 491 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
492
479 impl->windowAndServiceWorkerExposedMethod(); 493 impl->windowAndServiceWorkerExposedMethod();
480 } 494 }
481 495
482 static void windowAndServiceWorkerExposedMethodMethodCallback(const v8::Function CallbackInfo<v8::Value>& info) 496 static void windowAndServiceWorkerExposedMethodMethodCallback(const v8::Function CallbackInfo<v8::Value>& info)
483 { 497 {
484 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodM ethod(info); 498 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodM ethod(info);
485 } 499 }
486 500
487 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 501 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
488 { 502 {
489 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodB ooleanOrDOMStringArg", "TestInterface5", info.Holder(), info.GetIsolate()); 503 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "voidMethodBooleanOrDOMStringArg");
504
505 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
506
490 if (UNLIKELY(info.Length() < 1)) { 507 if (UNLIKELY(info.Length() < 1)) {
491 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 508 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
492 return; 509 return;
493 } 510 }
494 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 511
495 BooleanOrString arg; 512 BooleanOrString arg;
496 { 513 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversi onMode::NotNullable, exceptionState);
497 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConv ersionMode::NotNullable, exceptionState); 514 if (exceptionState.hadException())
498 if (exceptionState.hadException()) 515 return;
499 return; 516
500 }
501 impl->voidMethodBooleanOrDOMStringArg(arg); 517 impl->voidMethodBooleanOrDOMStringArg(arg);
502 } 518 }
503 519
504 static void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 520 static void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
505 { 521 {
506 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMetho d(info); 522 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMetho d(info);
507 } 523 }
508 524
509 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo< v8::Value>& info) 525 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo< v8::Value>& info)
510 { 526 {
511 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD oubleOrDOMStringArg", "TestInterface5", info.Holder(), info.GetIsolate()); 527 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "voidMethodDoubleOrDOMStringArg");
528
529 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
530
512 if (UNLIKELY(info.Length() < 1)) { 531 if (UNLIKELY(info.Length() < 1)) {
513 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 532 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
514 return; 533 return;
515 } 534 }
516 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 535
517 DoubleOrString arg; 536 DoubleOrString arg;
518 { 537 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversio nMode::NotNullable, exceptionState);
519 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConve rsionMode::NotNullable, exceptionState); 538 if (exceptionState.hadException())
520 if (exceptionState.hadException()) 539 return;
521 return; 540
522 }
523 impl->voidMethodDoubleOrDOMStringArg(arg); 541 impl->voidMethodDoubleOrDOMStringArg(arg);
524 } 542 }
525 543
526 static void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) 544 static void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info)
527 { 545 {
528 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod (info); 546 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod (info);
529 } 547 }
530 548
531 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 549 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
532 { 550 {
533 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes tInterface5", info.Holder(), info.GetIsolate()); 551 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "keys");
552
534 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 553 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
554
535 ScriptState* scriptState = ScriptState::forReceiverObject(info); 555 ScriptState* scriptState = ScriptState::forReceiverObject(info);
556
536 Iterator* result = impl->keysForBinding(scriptState, exceptionState); 557 Iterator* result = impl->keysForBinding(scriptState, exceptionState);
537 if (exceptionState.hadException()) { 558 if (exceptionState.hadException()) {
538 return; 559 return;
539 } 560 }
540 v8SetReturnValue(info, result); 561 v8SetReturnValue(info, result);
541 } 562 }
542 563
543 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 564 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
544 { 565 {
545 TestInterface5ImplementationV8Internal::keysMethod(info); 566 TestInterface5ImplementationV8Internal::keysMethod(info);
546 } 567 }
547 568
548 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 569 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
549 { 570 {
550 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T estInterface5", info.Holder(), info.GetIsolate()); 571 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "values");
572
551 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 573 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
574
552 ScriptState* scriptState = ScriptState::forReceiverObject(info); 575 ScriptState* scriptState = ScriptState::forReceiverObject(info);
576
553 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); 577 Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
554 if (exceptionState.hadException()) { 578 if (exceptionState.hadException()) {
555 return; 579 return;
556 } 580 }
557 v8SetReturnValue(info, result); 581 v8SetReturnValue(info, result);
558 } 582 }
559 583
560 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info ) 584 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info )
561 { 585 {
562 TestInterface5ImplementationV8Internal::valuesMethod(info); 586 TestInterface5ImplementationV8Internal::valuesMethod(info);
563 } 587 }
564 588
565 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 589 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
566 { 590 {
567 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", " TestInterface5", info.Holder(), info.GetIsolate()); 591 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "entries");
592
568 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 593 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
594
569 ScriptState* scriptState = ScriptState::forReceiverObject(info); 595 ScriptState* scriptState = ScriptState::forReceiverObject(info);
596
570 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); 597 Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
571 if (exceptionState.hadException()) { 598 if (exceptionState.hadException()) {
572 return; 599 return;
573 } 600 }
574 v8SetReturnValue(info, result); 601 v8SetReturnValue(info, result);
575 } 602 }
576 603
577 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 604 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
578 { 605 {
579 TestInterface5ImplementationV8Internal::entriesMethod(info); 606 TestInterface5ImplementationV8Internal::entriesMethod(info);
580 } 607 }
581 608
582 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 609 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
583 { 610 {
584 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", " TestInterface5", info.Holder(), info.GetIsolate()); 611 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "forEach");
612
613 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
614
615 ScriptState* scriptState = ScriptState::forReceiverObject(info);
616
585 if (UNLIKELY(info.Length() < 1)) { 617 if (UNLIKELY(info.Length() < 1)) {
586 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 618 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
587 return; 619 return;
588 } 620 }
589 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 621
590 ScriptValue callback; 622 ScriptValue callback;
591 ScriptValue thisArg; 623 ScriptValue thisArg;
592 { 624 if (!info[0]->IsFunction()) {
593 if (!info[0]->IsFunction()) { 625 exceptionState.throwTypeError("The callback provided as parameter 1 is n ot a function.");
594 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function."); 626
595 return; 627 return;
596 }
597 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]) ;
598 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
599 } 628 }
600 ScriptState* scriptState = ScriptState::forReceiverObject(info); 629 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
630
631 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
632
601 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()) , callback, thisArg, exceptionState); 633 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()) , callback, thisArg, exceptionState);
602 if (exceptionState.hadException()) { 634 if (exceptionState.hadException()) {
603 return; 635 return;
604 } 636 }
605 } 637 }
606 638
607 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 639 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
608 { 640 {
609 TestInterface5ImplementationV8Internal::forEachMethod(info); 641 TestInterface5ImplementationV8Internal::forEachMethod(info);
610 } 642 }
611 643
612 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 644 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
613 { 645 {
614 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 646 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
647
615 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); 648 v8SetReturnValueString(info, impl->toString(), info.GetIsolate());
616 } 649 }
617 650
618 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 651 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
619 { 652 {
620 TestInterface5ImplementationV8Internal::toStringMethod(info); 653 TestInterface5ImplementationV8Internal::toStringMethod(info);
621 } 654 }
622 655
623 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 656 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
624 { 657 {
625 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface5", info.Holder(), info.GetIsolate()); 658 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo ntext, "TestInterface5", "iterator");
659
626 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ; 660 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()) ;
661
627 ScriptState* scriptState = ScriptState::forReceiverObject(info); 662 ScriptState* scriptState = ScriptState::forReceiverObject(info);
663
628 Iterator* result = impl->iterator(scriptState, exceptionState); 664 Iterator* result = impl->iterator(scriptState, exceptionState);
629 if (exceptionState.hadException()) { 665 if (exceptionState.hadException()) {
630 return; 666 return;
631 } 667 }
632 v8SetReturnValue(info, result); 668 v8SetReturnValue(info, result);
633 } 669 }
634 670
635 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 671 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
636 { 672 {
637 TestInterface5ImplementationV8Internal::iteratorMethod(info); 673 TestInterface5ImplementationV8Internal::iteratorMethod(info);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV 8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; 958 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV 8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface};
923 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC onfiguration); 959 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC onfiguration);
924 } 960 }
925 if (executionContext && (executionContext->isDocument() || executionContext- >isServiceWorkerGlobalScope())) { 961 if (executionContext && (executionContext->isDocument() || executionContext- >isServiceWorkerGlobalScope())) {
926 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback , 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O nPrototype}; 962 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback , 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O nPrototype};
927 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet hodMethodConfiguration); 963 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>( ), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet hodMethodConfiguration);
928 } 964 }
929 } 965 }
930 966
931 } // namespace blink 967 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698