| 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 "config.h" | 7 #include "config.h" |
| 8 #if ENABLE(CONDITION) | 8 #if ENABLE(CONDITION) |
| 9 #include "V8TestInterface5.h" | 9 #include "V8TestInterface5.h" |
| 10 | 10 |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 | 779 |
| 780 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 780 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 781 { | 781 { |
| 782 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); | 782 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); |
| 783 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); | 783 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); |
| 784 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 784 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 785 } | 785 } |
| 786 | 786 |
| 787 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Value>& info) | 787 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 788 { | 788 { |
| 789 if (!name->IsString()) | |
| 790 return; | |
| 791 auto nameString = name.As<v8::String>(); | 789 auto nameString = name.As<v8::String>(); |
| 792 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); | |
| 793 if (v8CallBoolean(info.Holder()->HasRealNamedProperty(context, nameString))) | |
| 794 return; | |
| 795 v8::Local<v8::Value> namedPropertyValue; | |
| 796 if (info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString)
.ToLocal(&namedPropertyValue)) | |
| 797 return; | |
| 798 | |
| 799 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 790 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 800 AtomicString propertyName = toCoreAtomicString(nameString); | 791 AtomicString propertyName = toCoreAtomicString(nameString); |
| 801 String result = impl->anonymousNamedGetter(propertyName); | 792 String result = impl->anonymousNamedGetter(propertyName); |
| 802 if (result.isNull()) | 793 if (result.isNull()) |
| 803 return; | 794 return; |
| 804 v8SetReturnValueString(info, result, info.GetIsolate()); | 795 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 805 } | 796 } |
| 806 | 797 |
| 807 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 798 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) |
| 808 { | 799 { |
| 809 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | 800 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
| 810 TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info); | 801 TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info); |
| 811 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 802 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 812 } | 803 } |
| 813 | 804 |
| 814 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 805 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 815 { | 806 { |
| 816 if (!name->IsString()) | |
| 817 return; | |
| 818 auto nameString = name.As<v8::String>(); | 807 auto nameString = name.As<v8::String>(); |
| 819 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); | |
| 820 if (v8CallBoolean(info.Holder()->HasRealNamedProperty(context, nameString))) | |
| 821 return; | |
| 822 v8::Local<v8::Value> namedPropertyValue; | |
| 823 if (info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString)
.ToLocal(&namedPropertyValue)) | |
| 824 return; | |
| 825 | |
| 826 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 808 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 827 V8StringResource<> propertyName(nameString); | 809 V8StringResource<> propertyName(nameString); |
| 828 if (!propertyName.prepare()) | 810 if (!propertyName.prepare()) |
| 829 return; | 811 return; |
| 830 V8StringResource<> propertyValue = v8Value; | 812 V8StringResource<> propertyValue = v8Value; |
| 831 if (!propertyValue.prepare()) | 813 if (!propertyValue.prepare()) |
| 832 return; | 814 return; |
| 833 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); | 815 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); |
| 834 if (!result) | 816 if (!result) |
| 835 return; | 817 return; |
| 836 v8SetReturnValue(info, v8Value); | 818 v8SetReturnValue(info, v8Value); |
| 837 } | 819 } |
| 838 | 820 |
| 839 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 821 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 840 { | 822 { |
| 841 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | 823 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
| 842 TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, i
nfo); | 824 TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, i
nfo); |
| 843 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 825 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 844 } | 826 } |
| 845 | 827 |
| 846 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) | 828 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) |
| 847 { | 829 { |
| 848 if (!name->IsString()) | |
| 849 return; | |
| 850 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 830 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 851 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | 831 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 852 v8::String::Utf8Value namedProperty(name); | 832 v8::String::Utf8Value namedProperty(name); |
| 853 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface5", info.Holder(), info.GetIsolate()); | 833 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface5", info.Holder(), info.GetIsolate()); |
| 854 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | 834 bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
| 855 if (exceptionState.throwIfNeeded()) | 835 if (exceptionState.throwIfNeeded()) |
| 856 return; | 836 return; |
| 857 if (!result) | 837 if (!result) |
| 858 return; | 838 return; |
| 859 v8SetReturnValueInt(info, v8::None); | 839 v8SetReturnValueInt(info, v8::None); |
| 860 } | 840 } |
| 861 | 841 |
| 862 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) | 842 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) |
| 863 { | 843 { |
| 864 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | 844 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
| 865 TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info); | 845 TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info); |
| 866 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 846 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 867 } | 847 } |
| 868 | 848 |
| 869 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 849 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 870 { | 850 { |
| 871 if (!name->IsString()) | |
| 872 return; | |
| 873 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; | 851 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder())
; |
| 874 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | 852 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 875 DeleteResult result = impl->anonymousNamedDeleter(propertyName); | 853 DeleteResult result = impl->anonymousNamedDeleter(propertyName); |
| 876 if (result != DeleteUnknownProperty) | 854 if (result != DeleteUnknownProperty) |
| 877 return v8SetReturnValueBool(info, result == DeleteSuccess); | 855 return v8SetReturnValueBool(info, result == DeleteSuccess); |
| 878 } | 856 } |
| 879 | 857 |
| 880 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) | 858 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) |
| 881 { | 859 { |
| 882 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | 860 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 {"UNSIGNED_LONG", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}
, | 943 {"UNSIGNED_LONG", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}
, |
| 966 {"CONST_JAVASCRIPT", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort}, | 944 {"CONST_JAVASCRIPT", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort}, |
| 967 }; | 945 }; |
| 968 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem
plate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants)); | 946 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem
plate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants)); |
| 969 { | 947 { |
| 970 v8::IndexedPropertyHandlerConfiguration config(TestInterface5Implementat
ionV8Internal::indexedPropertyGetterCallback, TestInterface5ImplementationV8Inte
rnal::indexedPropertySetterCallback, 0, TestInterface5ImplementationV8Internal::
indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface5Implemen
tation>); | 948 v8::IndexedPropertyHandlerConfiguration config(TestInterface5Implementat
ionV8Internal::indexedPropertyGetterCallback, TestInterface5ImplementationV8Inte
rnal::indexedPropertySetterCallback, 0, TestInterface5ImplementationV8Internal::
indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface5Implemen
tation>); |
| 971 functionTemplate->InstanceTemplate()->SetHandler(config); | 949 functionTemplate->InstanceTemplate()->SetHandler(config); |
| 972 } | 950 } |
| 973 { | 951 { |
| 974 v8::NamedPropertyHandlerConfiguration config(TestInterface5Implementatio
nV8Internal::namedPropertyGetterCallback, TestInterface5ImplementationV8Internal
::namedPropertySetterCallback, TestInterface5ImplementationV8Internal::namedProp
ertyQueryCallback, TestInterface5ImplementationV8Internal::namedPropertyDeleterC
allback, TestInterface5ImplementationV8Internal::namedPropertyEnumeratorCallback
); | 952 v8::NamedPropertyHandlerConfiguration config(TestInterface5Implementatio
nV8Internal::namedPropertyGetterCallback, TestInterface5ImplementationV8Internal
::namedPropertySetterCallback, TestInterface5ImplementationV8Internal::namedProp
ertyQueryCallback, TestInterface5ImplementationV8Internal::namedPropertyDeleterC
allback, TestInterface5ImplementationV8Internal::namedPropertyEnumeratorCallback
); |
| 953 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co
nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings))
; |
| 954 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co
nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kNonMasking)); |
| 975 functionTemplate->InstanceTemplate()->SetHandler(config); | 955 functionTemplate->InstanceTemplate()->SetHandler(config); |
| 976 } | 956 } |
| 977 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI
teratorConfiguration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8
Internal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; | 957 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI
teratorConfiguration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8
Internal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; |
| 978 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu
re, v8::DontDelete, symbolKeyedIteratorConfiguration); | 958 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu
re, v8::DontDelete, symbolKeyedIteratorConfiguration); |
| 979 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
ce5::legacyCallCustom); | 959 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
ce5::legacyCallCustom); |
| 980 const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMethodMetho
dConfiguration = { | 960 const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMethodMetho
dConfiguration = { |
| 981 "alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::alw
aysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScri
pts, | 961 "alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::alw
aysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScri
pts, |
| 982 }; | 962 }; |
| 983 V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::S
ignature>(), v8::None, alwaysExposedStaticMethodMethodConfiguration); | 963 V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::S
ignature>(), v8::None, alwaysExposedStaticMethodMethodConfiguration); |
| 984 if (context && (context->isWorkerGlobalScope())) { | 964 if (context && (context->isWorkerGlobalScope())) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 scriptWrappable->toImpl<TestInterface5Implementation>()->ref(); | 1045 scriptWrappable->toImpl<TestInterface5Implementation>()->ref(); |
| 1066 } | 1046 } |
| 1067 | 1047 |
| 1068 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable) | 1048 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable) |
| 1069 { | 1049 { |
| 1070 scriptWrappable->toImpl<TestInterface5Implementation>()->deref(); | 1050 scriptWrappable->toImpl<TestInterface5Implementation>()->deref(); |
| 1071 } | 1051 } |
| 1072 | 1052 |
| 1073 } // namespace blink | 1053 } // namespace blink |
| 1074 #endif // ENABLE(CONDITION) | 1054 #endif // ENABLE(CONDITION) |
| OLD | NEW |