| 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 impl->anonymousNamedSetter(name, propertyValue); |
| 665 } |
| 666 |
| 667 void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 668 { |
| 669 if (!name->IsString()) |
| 670 return; |
| 671 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; |
| 672 |
| 673 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8
Value, info); |
| 674 } |
| 675 |
| 676 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 677 { |
| 678 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 679 |
| 680 DeleteResult result = impl->anonymousNamedDeleter(name); |
| 681 v8SetReturnValue(info, result != DeleteReject); |
| 682 } |
| 683 |
| 684 void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa
llbackInfo<v8::Boolean>& info) |
| 685 { |
| 686 if (!name->IsString()) |
| 687 return; |
| 688 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; |
| 689 |
| 690 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, i
nfo); |
| 691 } |
| 692 |
| 693 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) |
| 694 { |
| 695 const CString& nameInUtf8 = name.utf8(); |
| 696 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterConte
xt, "TestInterface5", nameInUtf8.data()); |
| 697 |
| 698 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 699 |
| 700 bool result = impl->namedPropertyQuery(name, exceptionState); |
| 701 if (!result) |
| 702 return; |
| 703 v8SetReturnValueInt(info, v8::None); |
| 704 } |
| 705 |
| 706 void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Integer>& info) |
| 707 { |
| 708 if (!name->IsString()) |
| 709 return; |
| 710 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>())
; |
| 711 |
| 712 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, inf
o); |
| 713 } |
| 714 |
| 715 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
| 716 { |
| 717 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Enumeration
Context, "TestInterface5"); |
| 718 |
| 719 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 720 |
| 721 Vector<String> names; |
| 722 impl->namedPropertyEnumerator(names, exceptionState); |
| 723 if (exceptionState.hadException()) |
| 724 return; |
| 725 v8SetReturnValue(info, toV8(names, info.Holder(), info.GetIsolate()).As<v8::
Array>()); |
| 726 } |
| 727 |
| 728 void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>&
info) |
| 729 { |
| 730 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); |
| 731 } |
| 732 |
| 639 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 733 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 640 { | 734 { |
| 641 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 735 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 736 |
| 642 String result = impl->anonymousIndexedGetter(index); | 737 String result = impl->anonymousIndexedGetter(index); |
| 643 if (result.isNull()) | 738 if (result.isNull()) |
| 644 return; | 739 return; |
| 645 v8SetReturnValueString(info, result, info.GetIsolate()); | 740 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 646 } | 741 } |
| 647 | 742 |
| 648 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
o<v8::Value>& info) | 743 void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
o<v8::Value>& info) |
| 649 { | 744 { |
| 650 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); | 745 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); |
| 651 } | 746 } |
| 652 | 747 |
| 653 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | 748 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 654 { | 749 { |
| 655 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 750 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 656 V8StringResource<> propertyValue = v8Value; | 751 V8StringResource<> propertyValue = v8Value; |
| 657 if (!propertyValue.prepare()) | 752 if (!propertyValue.prepare()) |
| 658 return; | 753 return; |
| 659 bool result = impl->anonymousIndexedSetter(index, propertyValue); | 754 |
| 660 if (!result) | 755 impl->anonymousIndexedSetter(index, propertyValue); |
| 661 return; | |
| 662 v8SetReturnValue(info, v8Value); | |
| 663 } | 756 } |
| 664 | 757 |
| 665 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | 758 void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 666 { | 759 { |
| 667 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value
, info); | 760 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value
, info); |
| 668 } | 761 } |
| 669 | 762 |
| 670 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) | 763 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) |
| 671 { | 764 { |
| 672 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 765 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 766 |
| 673 DeleteResult result = impl->anonymousIndexedDeleter(index); | 767 DeleteResult result = impl->anonymousIndexedDeleter(index); |
| 674 if (result != DeleteUnknownProperty) | 768 v8SetReturnValue(info, result != DeleteReject); |
| 675 return v8SetReturnValueBool(info, result == DeleteSuccess); | |
| 676 } | 769 } |
| 677 | 770 |
| 678 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
fo<v8::Boolean>& info) | 771 void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
fo<v8::Boolean>& info) |
| 679 { | 772 { |
| 680 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); | 773 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); |
| 681 } | 774 } |
| 682 | 775 |
| 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 | 776 } // namespace TestInterface5ImplementationV8Internal |
| 783 | 777 |
| 784 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) | 778 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc
riptWrappable, const v8::Persistent<v8::Object>& wrapper) |
| 785 { | 779 { |
| 786 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5I
mplementation>(); | 780 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5I
mplementation>(); |
| 787 TestInterface5Implementation* referencedName = impl->referencedName(); | 781 TestInterface5Implementation* referencedName = impl->referencedName(); |
| 788 if (referencedName) { | 782 if (referencedName) { |
| 789 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName
, isolate); | 783 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName
, isolate); |
| 790 } | 784 } |
| 791 } | 785 } |
| (...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}; | 911 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); | 912 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodC
onfiguration); |
| 919 } | 913 } |
| 920 if (executionContext && (executionContext->isDocument() || executionContext-
>isServiceWorkerGlobalScope())) { | 914 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}; | 915 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); | 916 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(
), prototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMet
hodMethodConfiguration); |
| 923 } | 917 } |
| 924 } | 918 } |
| 925 | 919 |
| 926 } // namespace blink | 920 } // namespace blink |
| OLD | NEW |