| 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/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 return; | 629 return; |
| 630 } | 630 } |
| 631 v8SetReturnValue(info, result); | 631 v8SetReturnValue(info, result); |
| 632 } | 632 } |
| 633 | 633 |
| 634 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 634 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 635 { | 635 { |
| 636 TestInterface5ImplementationV8Internal::iteratorMethod(info); | 636 TestInterface5ImplementationV8Internal::iteratorMethod(info); |
| 637 } | 637 } |
| 638 | 638 |
| 639 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 640 { |
| 641 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 642 String result = impl->anonymousNamedGetter(name); |
| 643 if (result.isNull()) |
| 644 return; |
| 645 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 646 } |
| 647 |
| 648 void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Value>& info) |
| 649 { |
| 650 if (!name->IsString()) |
| 651 return; |
| 652 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; |
| 653 |
| 654 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, in
fo); |
| 655 } |
| 656 |
| 657 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 658 { |
| 659 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 660 V8StringResource<> propertyValue = v8Value; |
| 661 if (!propertyValue.prepare()) |
| 662 return; |
| 663 |
| 664 bool result = impl->anonymousNamedSetter(name, propertyValue); |
| 665 if (!result) |
| 666 return; |
| 667 v8SetReturnValue(info, v8Value); |
| 668 } |
| 669 |
| 670 void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 671 { |
| 672 if (!name->IsString()) |
| 673 return; |
| 674 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; |
| 675 |
| 676 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8
Value, info); |
| 677 } |
| 678 |
| 679 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 680 { |
| 681 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 682 |
| 683 DeleteResult result = impl->anonymousNamedDeleter(name); |
| 684 if (result == DeleteUnknownProperty) |
| 685 return; |
| 686 v8SetReturnValue(info, result == DeleteSuccess); |
| 687 } |
| 688 |
| 689 void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa
llbackInfo<v8::Boolean>& info) |
| 690 { |
| 691 if (!name->IsString()) |
| 692 return; |
| 693 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; |
| 694 |
| 695 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, i
nfo); |
| 696 } |
| 697 |
| 698 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) |
| 699 { |
| 700 const CString& nameInUtf8 = name.utf8(); |
| 701 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterConte
xt, "TestInterface5", nameInUtf8.data()); |
| 702 |
| 703 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 704 |
| 705 bool result = impl->namedPropertyQuery(name, exceptionState); |
| 706 if (!result) |
| 707 return; |
| 708 v8SetReturnValueInt(info, v8::None); |
| 709 } |
| 710 |
| 711 void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Integer>& info) |
| 712 { |
| 713 if (!name->IsString()) |
| 714 return; |
| 715 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; |
| 716 |
| 717 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, inf
o); |
| 718 } |
| 719 |
| 720 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
| 721 { |
| 722 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Enumeration
Context, "TestInterface5"); |
| 723 |
| 724 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 725 |
| 726 Vector<String> names; |
| 727 impl->namedPropertyEnumerator(names, exceptionState); |
| 728 if (exceptionState.hadException()) |
| 729 return; |
| 730 v8SetReturnValue(info, toV8(names, info.Holder(), info.GetIsolate()).As<v8::
Array>()); |
| 731 } |
| 732 |
| 733 void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>&
info) |
| 734 { |
| 735 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); |
| 736 } |
| 737 |
| 639 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 738 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 640 { | 739 { |
| 641 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 740 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 741 |
| 642 String result = impl->anonymousIndexedGetter(index); | 742 String result = impl->anonymousIndexedGetter(index); |
| 643 if (result.isNull()) | 743 if (result.isNull()) |
| 644 return; | 744 return; |
| 645 v8SetReturnValueString(info, result, info.GetIsolate()); | 745 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 646 } | 746 } |
| 647 | 747 |
| 648 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
o<v8::Value>& info) | 748 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
o<v8::Value>& info) |
| 649 { | 749 { |
| 650 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); | 750 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); |
| 651 } | 751 } |
| 652 | 752 |
| 653 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | 753 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 654 { | 754 { |
| 655 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 755 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 656 V8StringResource<> propertyValue = v8Value; | 756 V8StringResource<> propertyValue = v8Value; |
| 657 if (!propertyValue.prepare()) | 757 if (!propertyValue.prepare()) |
| 658 return; | 758 return; |
| 759 |
| 659 bool result = impl->anonymousIndexedSetter(index, propertyValue); | 760 bool result = impl->anonymousIndexedSetter(index, propertyValue); |
| 660 if (!result) | 761 if (!result) |
| 661 return; | 762 return; |
| 662 v8SetReturnValue(info, v8Value); | 763 v8SetReturnValue(info, v8Value); |
| 663 } | 764 } |
| 664 | 765 |
| 665 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | 766 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 666 { | 767 { |
| 667 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value
, info); | 768 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value
, info); |
| 668 } | 769 } |
| 669 | 770 |
| 670 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) | 771 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) |
| 671 { | 772 { |
| 672 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 773 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 774 |
| 673 DeleteResult result = impl->anonymousIndexedDeleter(index); | 775 DeleteResult result = impl->anonymousIndexedDeleter(index); |
| 674 if (result != DeleteUnknownProperty) | 776 if (result == DeleteUnknownProperty) |
| 675 return v8SetReturnValueBool(info, result == DeleteSuccess); | 777 return; |
| 778 v8SetReturnValue(info, result == DeleteSuccess); |
| 676 } | 779 } |
| 677 | 780 |
| 678 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
fo<v8::Boolean>& info) | 781 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
fo<v8::Boolean>& info) |
| 679 { | 782 { |
| 680 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); | 783 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); |
| 681 } | 784 } |
| 682 | 785 |
| 683 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Value>& info) | |
| 684 { | |
| 685 auto nameString = name.As<v8::String>(); | |
| 686 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 687 AtomicString propertyName = toCoreAtomicString(nameString); | |
| 688 String result = impl->anonymousNamedGetter(propertyName); | |
| 689 if (result.isNull()) | |
| 690 return; | |
| 691 v8SetReturnValueString(info, result, info.GetIsolate()); | |
| 692 } | |
| 693 | |
| 694 void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Value>& info) | |
| 695 { | |
| 696 if (!name->IsString()) | |
| 697 return; | |
| 698 TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info); | |
| 699 } | |
| 700 | |
| 701 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 702 { | |
| 703 auto nameString = name.As<v8::String>(); | |
| 704 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 705 V8StringResource<> propertyName(nameString); | |
| 706 if (!propertyName.prepare()) | |
| 707 return; | |
| 708 V8StringResource<> propertyValue = v8Value; | |
| 709 if (!propertyValue.prepare()) | |
| 710 return; | |
| 711 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); | |
| 712 if (!result) | |
| 713 return; | |
| 714 v8SetReturnValue(info, v8Value); | |
| 715 } | |
| 716 | |
| 717 void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 718 { | |
| 719 if (!name->IsString()) | |
| 720 return; | |
| 721 TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, i
nfo); | |
| 722 } | |
| 723 | |
| 724 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) | |
| 725 { | |
| 726 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 727 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | |
| 728 v8::String::Utf8Value namedProperty(name); | |
| 729 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface5", info.Holder(), info.GetIsolate()); | |
| 730 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | |
| 731 if (exceptionState.hadException()) | |
| 732 return; | |
| 733 if (!result) | |
| 734 return; | |
| 735 v8SetReturnValueInt(info, v8::None); | |
| 736 } | |
| 737 | |
| 738 void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Integer>& info) | |
| 739 { | |
| 740 if (!name->IsString()) | |
| 741 return; | |
| 742 TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info); | |
| 743 } | |
| 744 | |
| 745 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | |
| 746 { | |
| 747 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 748 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | |
| 749 DeleteResult result = impl->anonymousNamedDeleter(propertyName); | |
| 750 if (result != DeleteUnknownProperty) | |
| 751 return v8SetReturnValueBool(info, result == DeleteSuccess); | |
| 752 } | |
| 753 | |
| 754 void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa
llbackInfo<v8::Boolean>& info) | |
| 755 { | |
| 756 if (!name->IsString()) | |
| 757 return; | |
| 758 TestInterface5ImplementationV8Internal::namedPropertyDeleter(name, info); | |
| 759 } | |
| 760 | |
| 761 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | |
| 762 { | |
| 763 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | |
| 764 Vector<String> names; | |
| 765 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter
face5", info.Holder(), info.GetIsolate()); | |
| 766 impl->namedPropertyEnumerator(names, exceptionState); | |
| 767 if (exceptionState.hadException()) | |
| 768 return; | |
| 769 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size(
)); | |
| 770 for (size_t i = 0; i < names.size(); ++i) { | |
| 771 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur
rentContext(), i, v8String(info.GetIsolate(), names[i])))) | |
| 772 return; | |
| 773 } | |
| 774 v8SetReturnValue(info, v8names); | |
| 775 } | |
| 776 | |
| 777 void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>&
info) | |
| 778 { | |
| 779 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); | |
| 780 } | |
| 781 | |
| 782 } // namespace TestInterface5ImplementationV8Internal | 786 } // namespace TestInterface5ImplementationV8Internal |
| 783 | 787 |
| 784 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) | 788 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) |
| 785 { | 789 { |
| 786 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5I
mplementation>(); | 790 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5I
mplementation>(); |
| 787 TestInterface5Implementation* referencedName = impl->referencedName(); | 791 TestInterface5Implementation* referencedName = impl->referencedName(); |
| 788 if (referencedName) { | 792 if (referencedName) { |
| 789 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName
, isolate); | 793 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName
, isolate); |
| 790 } | 794 } |
| 791 } | 795 } |
| (...skipping 125 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}; | 921 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); | 922 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC
onfiguration); |
| 919 } | 923 } |
| 920 if (executionContext && (executionContext->isDocument() || executionContext-
>isServiceWorkerGlobalScope())) { | 924 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}; | 925 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); | 926 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet
hodMethodConfiguration); |
| 923 } | 927 } |
| 924 } | 928 } |
| 925 | 929 |
| 926 } // namespace blink | 930 } // namespace blink |
| OLD | NEW |