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

Side by Side Diff: Source/bindings/tests/results/core/V8TestObject.cpp

Issue 567503002: Add toDouble() helper, and use toFloat()/toDouble() for conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 375 static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
376 { 376 {
377 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 377 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
378 TestObjectV8Internal::doubleAttributeAttributeGetter(info); 378 TestObjectV8Internal::doubleAttributeAttributeGetter(info);
379 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 379 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
380 } 380 }
381 381
382 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info) 382 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info)
383 { 383 {
384 v8::Handle<v8::Object> holder = info.Holder(); 384 v8::Handle<v8::Object> holder = info.Holder();
385 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribut e", "TestObject", holder, info.GetIsolate());
385 TestObject* impl = V8TestObject::toImpl(holder); 386 TestObject* impl = V8TestObject::toImpl(holder);
386 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())) ; 387 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, exceptionSt ate), exceptionState);
387 impl->setDoubleAttribute(cppValue); 388 impl->setDoubleAttribute(cppValue);
388 } 389 }
389 390
390 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 391 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
391 { 392 {
392 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 393 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
393 TestObjectV8Internal::doubleAttributeAttributeSetter(v8Value, info); 394 TestObjectV8Internal::doubleAttributeAttributeSetter(v8Value, info);
394 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 395 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
395 } 396 }
396 397
397 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info) 398 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info)
398 { 399 {
399 v8::Handle<v8::Object> holder = info.Holder(); 400 v8::Handle<v8::Object> holder = info.Holder();
400 TestObject* impl = V8TestObject::toImpl(holder); 401 TestObject* impl = V8TestObject::toImpl(holder);
401 v8SetReturnValue(info, impl->floatAttribute()); 402 v8SetReturnValue(info, impl->floatAttribute());
402 } 403 }
403 404
404 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info) 405 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info)
405 { 406 {
406 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 407 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
407 TestObjectV8Internal::floatAttributeAttributeGetter(info); 408 TestObjectV8Internal::floatAttributeAttributeGetter(info);
408 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 409 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
409 } 410 }
410 411
411 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::PropertyCallbackInfo<void>& info) 412 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::PropertyCallbackInfo<void>& info)
412 { 413 {
413 v8::Handle<v8::Object> holder = info.Holder(); 414 v8::Handle<v8::Object> holder = info.Holder();
415 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute ", "TestObject", holder, info.GetIsolate());
414 TestObject* impl = V8TestObject::toImpl(holder); 416 TestObject* impl = V8TestObject::toImpl(holder);
415 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); 417 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionStat e), exceptionState);
416 impl->setFloatAttribute(cppValue); 418 impl->setFloatAttribute(cppValue);
417 } 419 }
418 420
419 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 421 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
420 { 422 {
421 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 423 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
422 TestObjectV8Internal::floatAttributeAttributeSetter(v8Value, info); 424 TestObjectV8Internal::floatAttributeAttributeSetter(v8Value, info);
423 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 425 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
424 } 426 }
425 427
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 static void unrestrictedDoubleAttributeAttributeGetterCallback(v8::Local<v8::Str ing>, const v8::PropertyCallbackInfo<v8::Value>& info) 555 static void unrestrictedDoubleAttributeAttributeGetterCallback(v8::Local<v8::Str ing>, const v8::PropertyCallbackInfo<v8::Value>& info)
554 { 556 {
555 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 557 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
556 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeGetter(info); 558 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeGetter(info);
557 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 559 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
558 } 560 }
559 561
560 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::PropertyCallbackInfo<void>& info) 562 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::PropertyCallbackInfo<void>& info)
561 { 563 {
562 v8::Handle<v8::Object> holder = info.Holder(); 564 v8::Handle<v8::Object> holder = info.Holder();
565 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedDo ubleAttribute", "TestObject", holder, info.GetIsolate());
563 TestObject* impl = V8TestObject::toImpl(holder); 566 TestObject* impl = V8TestObject::toImpl(holder);
564 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())) ; 567 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, exceptionSt ate), exceptionState);
565 impl->setUnrestrictedDoubleAttribute(cppValue); 568 impl->setUnrestrictedDoubleAttribute(cppValue);
566 } 569 }
567 570
568 static void unrestrictedDoubleAttributeAttributeSetterCallback(v8::Local<v8::Str ing>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 571 static void unrestrictedDoubleAttributeAttributeSetterCallback(v8::Local<v8::Str ing>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
569 { 572 {
570 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 573 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
571 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, in fo); 574 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, in fo);
572 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 575 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
573 } 576 }
574 577
575 static void unrestrictedFloatAttributeAttributeGetter(const v8::PropertyCallback Info<v8::Value>& info) 578 static void unrestrictedFloatAttributeAttributeGetter(const v8::PropertyCallback Info<v8::Value>& info)
576 { 579 {
577 v8::Handle<v8::Object> holder = info.Holder(); 580 v8::Handle<v8::Object> holder = info.Holder();
578 TestObject* impl = V8TestObject::toImpl(holder); 581 TestObject* impl = V8TestObject::toImpl(holder);
579 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); 582 v8SetReturnValue(info, impl->unrestrictedFloatAttribute());
580 } 583 }
581 584
582 static void unrestrictedFloatAttributeAttributeGetterCallback(v8::Local<v8::Stri ng>, const v8::PropertyCallbackInfo<v8::Value>& info) 585 static void unrestrictedFloatAttributeAttributeGetterCallback(v8::Local<v8::Stri ng>, const v8::PropertyCallbackInfo<v8::Value>& info)
583 { 586 {
584 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 587 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
585 TestObjectV8Internal::unrestrictedFloatAttributeAttributeGetter(info); 588 TestObjectV8Internal::unrestrictedFloatAttributeAttributeGetter(info);
586 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 589 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
587 } 590 }
588 591
589 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val ue, const v8::PropertyCallbackInfo<void>& info) 592 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val ue, const v8::PropertyCallbackInfo<void>& info)
590 { 593 {
591 v8::Handle<v8::Object> holder = info.Holder(); 594 v8::Handle<v8::Object> holder = info.Holder();
595 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedFl oatAttribute", "TestObject", holder, info.GetIsolate());
592 TestObject* impl = V8TestObject::toImpl(holder); 596 TestObject* impl = V8TestObject::toImpl(holder);
593 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); 597 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionStat e), exceptionState);
594 impl->setUnrestrictedFloatAttribute(cppValue); 598 impl->setUnrestrictedFloatAttribute(cppValue);
595 } 599 }
596 600
597 static void unrestrictedFloatAttributeAttributeSetterCallback(v8::Local<v8::Stri ng>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 601 static void unrestrictedFloatAttributeAttributeSetterCallback(v8::Local<v8::Stri ng>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
598 { 602 {
599 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 603 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
600 TestObjectV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, inf o); 604 TestObjectV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, inf o);
601 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 605 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
602 } 606 }
603 607
(...skipping 3790 matching lines...) Expand 10 before | Expand all | Expand 10 after
4394 static void typeCheckingInterfaceFloatAttributeAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4398 static void typeCheckingInterfaceFloatAttributeAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
4395 { 4399 {
4396 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4400 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
4397 TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeGetter(inf o); 4401 TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeGetter(inf o);
4398 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4402 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
4399 } 4403 }
4400 4404
4401 static void typeCheckingInterfaceFloatAttributeAttributeSetter(v8::Local<v8::Val ue> v8Value, const v8::PropertyCallbackInfo<void>& info) 4405 static void typeCheckingInterfaceFloatAttributeAttributeSetter(v8::Local<v8::Val ue> v8Value, const v8::PropertyCallbackInfo<void>& info)
4402 { 4406 {
4403 v8::Handle<v8::Object> holder = info.Holder(); 4407 v8::Handle<v8::Object> holder = info.Holder();
4408 ExceptionState exceptionState(ExceptionState::SetterContext, "typeCheckingIn terfaceFloatAttribute", "TestObject", holder, info.GetIsolate());
4404 TestObject* impl = V8TestObject::toImpl(holder); 4409 TestObject* impl = V8TestObject::toImpl(holder);
4405 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); 4410 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionStat e), exceptionState);
4406 impl->setTypeCheckingInterfaceFloatAttribute(cppValue); 4411 impl->setTypeCheckingInterfaceFloatAttribute(cppValue);
4407 } 4412 }
4408 4413
4409 static void typeCheckingInterfaceFloatAttributeAttributeSetterCallback(v8::Local <v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void> & info) 4414 static void typeCheckingInterfaceFloatAttributeAttributeSetterCallback(v8::Local <v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void> & info)
4410 { 4415 {
4411 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4416 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
4412 TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeSetter(v8V alue, info); 4417 TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeSetter(v8V alue, info);
4413 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4418 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
4414 } 4419 }
4415 4420
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
5322 5327
5323 static void voidMethodByteArgMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 5328 static void voidMethodByteArgMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
5324 { 5329 {
5325 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5330 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5326 TestObjectV8Internal::voidMethodByteArgMethod(info); 5331 TestObjectV8Internal::voidMethodByteArgMethod(info);
5327 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5332 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5328 } 5333 }
5329 5334
5330 static void voidMethodDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5335 static void voidMethodDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5331 { 5336 {
5337 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD oubleArg", "TestObject", info.Holder(), info.GetIsolate());
5332 if (UNLIKELY(info.Length() < 1)) { 5338 if (UNLIKELY(info.Length() < 1)) {
5333 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("v oidMethodDoubleArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.Ge tIsolate()); 5339 setMinimumArityTypeError(exceptionState, 1, info.Length());
5340 exceptionState.throwIfNeeded();
5334 return; 5341 return;
5335 } 5342 }
5336 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5343 TestObject* impl = V8TestObject::toImpl(info.Holder());
5337 double doubleArg; 5344 double doubleArg;
5338 { 5345 {
5339 v8::TryCatch block; 5346 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], excep tionState), exceptionState);
5340 V8RethrowTryCatchScope rethrow(block);
5341 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberVal ue()));
5342 } 5347 }
5343 impl->voidMethodDoubleArg(doubleArg); 5348 impl->voidMethodDoubleArg(doubleArg);
5344 } 5349 }
5345 5350
5346 static void voidMethodDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 5351 static void voidMethodDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
5347 { 5352 {
5348 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5353 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5349 TestObjectV8Internal::voidMethodDoubleArgMethod(info); 5354 TestObjectV8Internal::voidMethodDoubleArgMethod(info);
5350 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5355 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5351 } 5356 }
5352 5357
5353 static void voidMethodFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5358 static void voidMethodFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5354 { 5359 {
5360 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodF loatArg", "TestObject", info.Holder(), info.GetIsolate());
5355 if (UNLIKELY(info.Length() < 1)) { 5361 if (UNLIKELY(info.Length() < 1)) {
5356 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("v oidMethodFloatArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.Get Isolate()); 5362 setMinimumArityTypeError(exceptionState, 1, info.Length());
5363 exceptionState.throwIfNeeded();
5357 return; 5364 return;
5358 } 5365 }
5359 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5366 TestObject* impl = V8TestObject::toImpl(info.Holder());
5360 float floatArg; 5367 float floatArg;
5361 { 5368 {
5362 v8::TryCatch block; 5369 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toFloat(info[0], excepti onState), exceptionState);
5363 V8RethrowTryCatchScope rethrow(block);
5364 TONATIVE_VOID_INTERNAL(floatArg, static_cast<float>(info[0]->NumberValue ()));
5365 } 5370 }
5366 impl->voidMethodFloatArg(floatArg); 5371 impl->voidMethodFloatArg(floatArg);
5367 } 5372 }
5368 5373
5369 static void voidMethodFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 5374 static void voidMethodFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
5370 { 5375 {
5371 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5376 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5372 TestObjectV8Internal::voidMethodFloatArgMethod(info); 5377 TestObjectV8Internal::voidMethodFloatArgMethod(info);
5373 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5378 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5374 } 5379 }
(...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after
7270 7275
7271 static void voidMethodDefaultIntegerArgsMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info) 7276 static void voidMethodDefaultIntegerArgsMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info)
7272 { 7277 {
7273 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7278 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
7274 TestObjectV8Internal::voidMethodDefaultIntegerArgsMethod(info); 7279 TestObjectV8Internal::voidMethodDefaultIntegerArgsMethod(info);
7275 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7280 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
7276 } 7281 }
7277 7282
7278 static void voidMethodDefaultDoubleArgMethod(const v8::FunctionCallbackInfo<v8:: Value>& info) 7283 static void voidMethodDefaultDoubleArgMethod(const v8::FunctionCallbackInfo<v8:: Value>& info)
7279 { 7284 {
7285 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD efaultDoubleArg", "TestObject", info.Holder(), info.GetIsolate());
7280 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7286 TestObject* impl = V8TestObject::toImpl(info.Holder());
7281 double defaultDoubleArg; 7287 double defaultDoubleArg;
7282 { 7288 {
7283 v8::TryCatch block;
7284 V8RethrowTryCatchScope rethrow(block);
7285 if (!info[0]->IsUndefined()) { 7289 if (!info[0]->IsUndefined()) {
7286 TONATIVE_VOID_INTERNAL(defaultDoubleArg, static_cast<double>(info[0] ->NumberValue())); 7290 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultDoubleArg, toDouble(inf o[0], exceptionState), exceptionState);
7287 } else { 7291 } else {
7288 defaultDoubleArg = 0.5; 7292 defaultDoubleArg = 0.5;
7289 } 7293 }
7290 } 7294 }
7291 impl->voidMethodDefaultDoubleArg(defaultDoubleArg); 7295 impl->voidMethodDefaultDoubleArg(defaultDoubleArg);
7292 } 7296 }
7293 7297
7294 static void voidMethodDefaultDoubleArgMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info) 7298 static void voidMethodDefaultDoubleArgMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info)
7295 { 7299 {
7296 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7300 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
7850 impl->overloadedMethodF(); 7854 impl->overloadedMethodF();
7851 return; 7855 return;
7852 } 7856 }
7853 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7857 TOSTRING_VOID_INTERNAL(stringArg, info[0]);
7854 } 7858 }
7855 impl->overloadedMethodF(stringArg); 7859 impl->overloadedMethodF(stringArg);
7856 } 7860 }
7857 7861
7858 static void overloadedMethodF2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7862 static void overloadedMethodF2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
7859 { 7863 {
7864 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodF", "TestObject", info.Holder(), info.GetIsolate());
7860 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7865 TestObject* impl = V8TestObject::toImpl(info.Holder());
7861 double doubleArg; 7866 double doubleArg;
7862 { 7867 {
7863 v8::TryCatch block; 7868 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], excep tionState), exceptionState);
7864 V8RethrowTryCatchScope rethrow(block);
7865 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberVal ue()));
7866 } 7869 }
7867 impl->overloadedMethodF(doubleArg); 7870 impl->overloadedMethodF(doubleArg);
7868 } 7871 }
7869 7872
7870 static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 7873 static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
7871 { 7874 {
7872 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodF", "TestObject", info.Holder(), info.GetIsolate()); 7875 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodF", "TestObject", info.Holder(), info.GetIsolate());
7873 switch (std::min(1, info.Length())) { 7876 switch (std::min(1, info.Length())) {
7874 case 0: 7877 case 0:
7875 if (true) { 7878 if (true) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
8041 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8044 TestObject* impl = V8TestObject::toImpl(info.Holder());
8042 V8StringResource<> stringArg; 8045 V8StringResource<> stringArg;
8043 { 8046 {
8044 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 8047 TOSTRING_VOID_INTERNAL(stringArg, info[0]);
8045 } 8048 }
8046 impl->overloadedMethodI(stringArg); 8049 impl->overloadedMethodI(stringArg);
8047 } 8050 }
8048 8051
8049 static void overloadedMethodI2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8052 static void overloadedMethodI2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
8050 { 8053 {
8054 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodI", "TestObject", info.Holder(), info.GetIsolate());
8051 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8055 TestObject* impl = V8TestObject::toImpl(info.Holder());
8052 double doubleArg; 8056 double doubleArg;
8053 { 8057 {
8054 v8::TryCatch block; 8058 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], excep tionState), exceptionState);
8055 V8RethrowTryCatchScope rethrow(block);
8056 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberVal ue()));
8057 } 8059 }
8058 impl->overloadedMethodI(doubleArg); 8060 impl->overloadedMethodI(doubleArg);
8059 } 8061 }
8060 8062
8061 static void overloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 8063 static void overloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
8062 { 8064 {
8063 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodI", "TestObject", info.Holder(), info.GetIsolate()); 8065 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodI", "TestObject", info.Holder(), info.GetIsolate());
8064 switch (std::min(1, info.Length())) { 8066 switch (std::min(1, info.Length())) {
8065 case 1: 8067 case 1:
8066 if (info[0]->IsNumber()) { 8068 if (info[0]->IsNumber()) {
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
9767 9769
9768 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethodCa llback(const v8::FunctionCallbackInfo<v8::Value>& info) 9770 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethodCa llback(const v8::FunctionCallbackInfo<v8::Value>& info)
9769 { 9771 {
9770 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9772 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
9771 TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyVaria dicArgMethod(info); 9773 TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyVaria dicArgMethod(info);
9772 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9774 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
9773 } 9775 }
9774 9776
9775 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info) 9777 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info)
9776 { 9778 {
9779 ExceptionState exceptionState(ExceptionState::ExecutionContext, "typeCheckin gUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", info.Holder(), info.Get Isolate());
9777 if (UNLIKELY(info.Length() < 2)) { 9780 if (UNLIKELY(info.Length() < 2)) {
9778 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("t ypeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", 2, info.Lengt h(), info.GetIsolate()), info.GetIsolate()); 9781 setMinimumArityTypeError(exceptionState, 2, info.Length());
9782 exceptionState.throwIfNeeded();
9779 return; 9783 return;
9780 } 9784 }
9781 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9785 TestObject* impl = V8TestObject::toImpl(info.Holder());
9782 float floatArg; 9786 float floatArg;
9783 double doubleArg; 9787 double doubleArg;
9784 { 9788 {
9785 v8::TryCatch block; 9789 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toFloat(info[0], excepti onState), exceptionState);
9786 V8RethrowTryCatchScope rethrow(block);
9787 TONATIVE_VOID_INTERNAL(floatArg, static_cast<float>(info[0]->NumberValue ()));
9788 if (!std::isfinite(floatArg)) { 9790 if (!std::isfinite(floatArg)) {
9789 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute( "typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", "float para meter 1 is non-finite."), info.GetIsolate()); 9791 exceptionState.throwTypeError("float parameter 1 is non-finite.");
9792 exceptionState.throwIfNeeded();
9790 return; 9793 return;
9791 } 9794 }
9792 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[1]->NumberVal ue())); 9795 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[1], excep tionState), exceptionState);
9793 if (!std::isfinite(doubleArg)) { 9796 if (!std::isfinite(doubleArg)) {
9794 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute( "typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", "double par ameter 2 is non-finite."), info.GetIsolate()); 9797 exceptionState.throwTypeError("double parameter 2 is non-finite.");
9798 exceptionState.throwIfNeeded();
9795 return; 9799 return;
9796 } 9800 }
9797 } 9801 }
9798 impl->typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(floatArg, doubleAr g); 9802 impl->typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(floatArg, doubleAr g);
9799 } 9803 }
9800 9804
9801 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info) 9805 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info)
9802 { 9806 {
9803 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9807 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
9804 TestObjectV8Internal::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMet hod(info); 9808 TestObjectV8Internal::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMet hod(info);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
10028 Node* node; 10032 Node* node;
10029 int value1; 10033 int value1;
10030 double value2; 10034 double value2;
10031 V8StringResource<> string; 10035 V8StringResource<> string;
10032 { 10036 {
10033 v8::TryCatch block; 10037 v8::TryCatch block;
10034 V8RethrowTryCatchScope rethrow(block); 10038 V8RethrowTryCatchScope rethrow(block);
10035 TONATIVE_VOID_INTERNAL(document, V8Document::toImplWithTypeCheck(info.Ge tIsolate(), info[0])); 10039 TONATIVE_VOID_INTERNAL(document, V8Document::toImplWithTypeCheck(info.Ge tIsolate(), info[0]));
10036 TONATIVE_VOID_INTERNAL(node, V8Node::toImplWithTypeCheck(info.GetIsolate (), info[1])); 10040 TONATIVE_VOID_INTERNAL(node, V8Node::toImplWithTypeCheck(info.GetIsolate (), info[1]));
10037 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value1, toInt16(info[2], exception State), exceptionState); 10041 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value1, toInt16(info[2], exception State), exceptionState);
10038 TONATIVE_VOID_INTERNAL(value2, static_cast<double>(info[3]->NumberValue( ))); 10042 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value2, toDouble(info[3], exceptio nState), exceptionState);
10039 TOSTRING_VOID_INTERNAL(string, info[4]); 10043 TOSTRING_VOID_INTERNAL(string, info[4]);
10040 } 10044 }
10041 RefPtrWillBeRawPtr<Node> result = nullptr; 10045 RefPtrWillBeRawPtr<Node> result = nullptr;
10042 if (!V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedI nPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext() ), impl, document, node, value1, value2, string, &result)) 10046 if (!V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedI nPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext() ), impl, document, node, value1, value2, string, &result))
10043 return; 10047 return;
10044 v8SetReturnValue(info, result.release()); 10048 v8SetReturnValue(info, result.release());
10045 } 10049 }
10046 10050
10047 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodCallba ck(const v8::FunctionCallbackInfo<v8::Value>& info) 10051 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodCallba ck(const v8::FunctionCallbackInfo<v8::Value>& info)
10048 { 10052 {
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
11193 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "enumF orPrivateScript", holder, v8String(scriptState->isolate(), cppValue)); 11197 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "enumF orPrivateScript", holder, v8String(scriptState->isolate(), cppValue));
11194 if (block.HasCaught()) { 11198 if (block.HasCaught()) {
11195 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat e(), exceptionState, block); 11199 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat e(), exceptionState, block);
11196 block.ReThrow(); 11200 block.ReThrow();
11197 return false; 11201 return false;
11198 } 11202 }
11199 return true; 11203 return true;
11200 } 11204 }
11201 11205
11202 } // namespace blink 11206 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698