| 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 "V8TestInterface2.h" | 7 #include "V8TestInterface2.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return v8SetReturnValueBool(info, result == DeleteSuccess); | 441 return v8SetReturnValueBool(info, result == DeleteSuccess); |
| 442 } | 442 } |
| 443 | 443 |
| 444 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 444 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 445 { | 445 { |
| 446 TestInterface2V8Internal::indexedPropertyDeleter(index, info); | 446 TestInterface2V8Internal::indexedPropertyDeleter(index, info); |
| 447 } | 447 } |
| 448 | 448 |
| 449 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Value>& info) | 449 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 450 { | 450 { |
| 451 if (!name->IsString()) | |
| 452 return; | |
| 453 auto nameString = name.As<v8::String>(); | 451 auto nameString = name.As<v8::String>(); |
| 454 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 452 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 455 AtomicString propertyName = toCoreAtomicString(nameString); | 453 AtomicString propertyName = toCoreAtomicString(nameString); |
| 456 v8::String::Utf8Value namedProperty(nameString); | 454 v8::String::Utf8Value namedProperty(nameString); |
| 457 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); | 455 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 458 TestInterfaceEmpty* result = impl->namedItem(propertyName, exceptionState); | 456 TestInterfaceEmpty* result = impl->namedItem(propertyName, exceptionState); |
| 459 if (exceptionState.throwIfNeeded()) | 457 if (exceptionState.throwIfNeeded()) |
| 460 return; | 458 return; |
| 461 if (!result) | 459 if (!result) |
| 462 return; | 460 return; |
| 463 v8SetReturnValueFast(info, result, impl); | 461 v8SetReturnValueFast(info, result, impl); |
| 464 } | 462 } |
| 465 | 463 |
| 466 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 464 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) |
| 467 { | 465 { |
| 466 if (!name->IsString()) |
| 467 return; |
| 468 TestInterface2V8Internal::namedPropertyGetter(name, info); | 468 TestInterface2V8Internal::namedPropertyGetter(name, info); |
| 469 } | 469 } |
| 470 | 470 |
| 471 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 471 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 472 { | 472 { |
| 473 if (!name->IsString()) | |
| 474 return; | |
| 475 auto nameString = name.As<v8::String>(); | 473 auto nameString = name.As<v8::String>(); |
| 476 v8::String::Utf8Value namedProperty(nameString); | 474 v8::String::Utf8Value namedProperty(nameString); |
| 477 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); | 475 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 478 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 476 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 479 V8StringResource<> propertyName(nameString); | 477 V8StringResource<> propertyName(nameString); |
| 480 if (!propertyName.prepare()) | 478 if (!propertyName.prepare()) |
| 481 return; | 479 return; |
| 482 TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), v8Value); | 480 TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), v8Value); |
| 483 if (!propertyValue && !isUndefinedOrNull(v8Value)) { | 481 if (!propertyValue && !isUndefinedOrNull(v8Value)) { |
| 484 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terfaceEmpty'."); | 482 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terfaceEmpty'."); |
| 485 exceptionState.throwIfNeeded(); | 483 exceptionState.throwIfNeeded(); |
| 486 return; | 484 return; |
| 487 } | 485 } |
| 488 bool result = impl->setNamedItem(propertyName, propertyValue, exceptionState
); | 486 bool result = impl->setNamedItem(propertyName, propertyValue, exceptionState
); |
| 489 if (exceptionState.throwIfNeeded()) | 487 if (exceptionState.throwIfNeeded()) |
| 490 return; | 488 return; |
| 491 if (!result) | 489 if (!result) |
| 492 return; | 490 return; |
| 493 v8SetReturnValue(info, v8Value); | 491 v8SetReturnValue(info, v8Value); |
| 494 } | 492 } |
| 495 | 493 |
| 496 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 494 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 497 { | 495 { |
| 496 if (!name->IsString()) |
| 497 return; |
| 498 TestInterface2V8Internal::namedPropertySetter(name, v8Value, info); | 498 TestInterface2V8Internal::namedPropertySetter(name, v8Value, info); |
| 499 } | 499 } |
| 500 | 500 |
| 501 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) | 501 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) |
| 502 { | 502 { |
| 503 if (!name->IsString()) | |
| 504 return; | |
| 505 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 503 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 506 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | 504 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 507 v8::String::Utf8Value namedProperty(name); | 505 v8::String::Utf8Value namedProperty(name); |
| 508 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); | 506 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface2", info.Holder(), info.GetIsolate()); |
| 509 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | 507 bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
| 510 if (exceptionState.throwIfNeeded()) | 508 if (exceptionState.throwIfNeeded()) |
| 511 return; | 509 return; |
| 512 if (!result) | 510 if (!result) |
| 513 return; | 511 return; |
| 514 v8SetReturnValueInt(info, v8::None); | 512 v8SetReturnValueInt(info, v8::None); |
| 515 } | 513 } |
| 516 | 514 |
| 517 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) | 515 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) |
| 518 { | 516 { |
| 517 if (!name->IsString()) |
| 518 return; |
| 519 TestInterface2V8Internal::namedPropertyQuery(name, info); | 519 TestInterface2V8Internal::namedPropertyQuery(name, info); |
| 520 } | 520 } |
| 521 | 521 |
| 522 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 522 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 523 { | 523 { |
| 524 if (!name->IsString()) | |
| 525 return; | |
| 526 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 524 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 527 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | 525 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 528 v8::String::Utf8Value namedProperty(name); | 526 v8::String::Utf8Value namedProperty(name); |
| 529 ExceptionState exceptionState(ExceptionState::DeletionContext, *namedPropert
y, "TestInterface2", info.Holder(), info.GetIsolate()); | 527 ExceptionState exceptionState(ExceptionState::DeletionContext, *namedPropert
y, "TestInterface2", info.Holder(), info.GetIsolate()); |
| 530 DeleteResult result = impl->deleteNamedItem(propertyName, exceptionState); | 528 DeleteResult result = impl->deleteNamedItem(propertyName, exceptionState); |
| 531 if (exceptionState.throwIfNeeded()) | 529 if (exceptionState.throwIfNeeded()) |
| 532 return; | 530 return; |
| 533 if (result != DeleteUnknownProperty) | 531 if (result != DeleteUnknownProperty) |
| 534 return v8SetReturnValueBool(info, result == DeleteSuccess); | 532 return v8SetReturnValueBool(info, result == DeleteSuccess); |
| 535 } | 533 } |
| 536 | 534 |
| 537 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) | 535 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) |
| 538 { | 536 { |
| 537 if (!name->IsString()) |
| 538 return; |
| 539 TestInterface2V8Internal::namedPropertyDeleter(name, info); | 539 TestInterface2V8Internal::namedPropertyDeleter(name, info); |
| 540 } | 540 } |
| 541 | 541 |
| 542 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 542 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
| 543 { | 543 { |
| 544 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); | 544 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); |
| 545 Vector<String> names; | 545 Vector<String> names; |
| 546 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter
face2", info.Holder(), info.GetIsolate()); | 546 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter
face2", info.Holder(), info.GetIsolate()); |
| 547 impl->namedPropertyEnumerator(names, exceptionState); | 547 impl->namedPropertyEnumerator(names, exceptionState); |
| 548 if (exceptionState.throwIfNeeded()) | 548 if (exceptionState.throwIfNeeded()) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 InstallTemplateFunction V8TestInterface2::installV8TestInterface2TemplateFunctio
n = (InstallTemplateFunction)&V8TestInterface2::installV8TestInterface2Template; | 664 InstallTemplateFunction V8TestInterface2::installV8TestInterface2TemplateFunctio
n = (InstallTemplateFunction)&V8TestInterface2::installV8TestInterface2Template; |
| 665 | 665 |
| 666 void V8TestInterface2::updateWrapperTypeInfo(InstallTemplateFunction installTemp
lateFunction, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInte
rfaceObjectFunction) | 666 void V8TestInterface2::updateWrapperTypeInfo(InstallTemplateFunction installTemp
lateFunction, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInte
rfaceObjectFunction) |
| 667 { | 667 { |
| 668 V8TestInterface2::installV8TestInterface2TemplateFunction = installTemplateF
unction; | 668 V8TestInterface2::installV8TestInterface2TemplateFunction = installTemplateF
unction; |
| 669 if (preparePrototypeAndInterfaceObjectFunction) | 669 if (preparePrototypeAndInterfaceObjectFunction) |
| 670 V8TestInterface2::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunc
tion = preparePrototypeAndInterfaceObjectFunction; | 670 V8TestInterface2::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunc
tion = preparePrototypeAndInterfaceObjectFunction; |
| 671 } | 671 } |
| 672 | 672 |
| 673 } // namespace blink | 673 } // namespace blink |
| OLD | NEW |