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