| 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 14 matching lines...) Expand all Loading... |
| 25 #include "wtf/RefPtr.h" | 25 #include "wtf/RefPtr.h" |
| 26 | 26 |
| 27 namespace blink { | 27 namespace blink { |
| 28 | 28 |
| 29 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 29 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
| 30 // and does not depend on another global objects. | 30 // and does not depend on another global objects. |
| 31 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 31 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 32 #pragma clang diagnostic push | 32 #pragma clang diagnostic push |
| 33 #pragma clang diagnostic ignored "-Wglobal-constructors" | 33 #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 34 #endif | 34 #endif |
| 35 const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink,
V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::d
erefObject, V8TestInterface5::trace, V8TestInterface5::toActiveDOMObject, V8Test
Interface5::visitDOMWrapper, V8TestInterface5::preparePrototypeObject, V8TestInt
erface5::installConditionallyEnabledProperties, "TestInterface5", &V8TestInterfa
ceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTy
peInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeIn
fo::Dependent, WrapperTypeInfo::RefCountedObject }; | 35 const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink,
V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::d
erefObject, V8TestInterface5::trace, V8TestInterface5::toActiveDOMObject, V8Test
Interface5::visitDOMWrapper, V8TestInterface5::preparePrototypeAndInterfaceObjec
t, V8TestInterface5::installConditionallyEnabledProperties, "TestInterface5", &V
8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototyp
e, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, W
rapperTypeInfo::Dependent, WrapperTypeInfo::RefCountedObject }; |
| 36 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 36 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 37 #pragma clang diagnostic pop | 37 #pragma clang diagnostic pop |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
e5Implementation.h. | 40 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
e5Implementation.h. |
| 41 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 41 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 42 // bindings/core/v8/ScriptWrappable.h. | 42 // bindings/core/v8/ScriptWrappable.h. |
| 43 const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestI
nterface5::wrapperTypeInfo; | 43 const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestI
nterface5::wrapperTypeInfo; |
| 44 | 44 |
| 45 namespace TestInterface5ImplementationV8Internal { | 45 namespace TestInterface5ImplementationV8Internal { |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 {"testInterfaceAttribute", TestInterface5ImplementationV8Internal::testInter
faceAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::te
stInterfaceAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v
8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC
onfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 933 {"testInterfaceAttribute", TestInterface5ImplementationV8Internal::testInter
faceAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::te
stInterfaceAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v
8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC
onfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 934 {"doubleAttribute", TestInterface5ImplementationV8Internal::doubleAttributeA
ttributeGetterCallback, TestInterface5ImplementationV8Internal::doubleAttributeA
ttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>
(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProto
type, V8DOMConfiguration::CheckHolder}, | 934 {"doubleAttribute", TestInterface5ImplementationV8Internal::doubleAttributeA
ttributeGetterCallback, TestInterface5ImplementationV8Internal::doubleAttributeA
ttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>
(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProto
type, V8DOMConfiguration::CheckHolder}, |
| 935 {"floatAttribute", TestInterface5ImplementationV8Internal::floatAttributeAtt
ributeGetterCallback, TestInterface5ImplementationV8Internal::floatAttributeAttr
ibuteSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8
::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototyp
e, V8DOMConfiguration::CheckHolder}, | 935 {"floatAttribute", TestInterface5ImplementationV8Internal::floatAttributeAtt
ributeGetterCallback, TestInterface5ImplementationV8Internal::floatAttributeAttr
ibuteSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8
::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototyp
e, V8DOMConfiguration::CheckHolder}, |
| 936 {"unrestrictedDoubleAttribute", TestInterface5ImplementationV8Internal::unre
strictedDoubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8In
ternal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT
, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAll
Scripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 936 {"unrestrictedDoubleAttribute", TestInterface5ImplementationV8Internal::unre
strictedDoubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8In
ternal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT
, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAll
Scripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 937 {"unrestrictedFloatAttribute", TestInterface5ImplementationV8Internal::unres
trictedFloatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Inte
rnal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, s
tatic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScr
ipts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 937 {"unrestrictedFloatAttribute", TestInterface5ImplementationV8Internal::unres
trictedFloatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Inte
rnal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, s
tatic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScr
ipts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 938 {"staticStringAttribute", TestInterface5ImplementationV8Internal::staticStri
ngAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::stat
icStringAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::
PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConf
iguration::OnInterface, V8DOMConfiguration::CheckHolder}, | 938 {"staticStringAttribute", TestInterface5ImplementationV8Internal::staticStri
ngAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::stat
icStringAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::
PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConf
iguration::OnInterface, V8DOMConfiguration::CheckHolder}, |
| 939 {"alwaysExposedAttribute", TestInterface5ImplementationV8Internal::alwaysExp
osedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::al
waysExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v
8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC
onfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 939 {"alwaysExposedAttribute", TestInterface5ImplementationV8Internal::alwaysExp
osedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::al
waysExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v
8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMC
onfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 940 }; | 940 }; |
| 941 | 941 |
| 942 const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = { | 942 const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = { |
| 943 {"voidMethodTestInterfaceEmptyArg", TestInterface5ImplementationV8Internal::
voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::Exposed
ToAllScripts, V8DOMConfiguration::OnPrototype}, | 943 {"voidMethodTestInterfaceEmptyArg", TestInterface5ImplementationV8Internal::
voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, v8::None, V8DOMConfiguratio
n::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 944 {"voidMethodDoubleArgFloatArg", TestInterface5ImplementationV8Internal::void
MethodDoubleArgFloatArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScr
ipts, V8DOMConfiguration::OnPrototype}, | 944 {"voidMethodDoubleArgFloatArg", TestInterface5ImplementationV8Internal::void
MethodDoubleArgFloatArgMethodCallback, 0, 2, v8::None, V8DOMConfiguration::Expos
edToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 945 {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", TestInterface5Implem
entationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCal
lback, 0, 2, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProt
otype}, | 945 {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", TestInterface5Implem
entationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCal
lback, 0, 2, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfigurati
on::OnPrototype}, |
| 946 {"voidMethod", TestInterface5ImplementationV8Internal::voidMethodMethodCallb
ack, TestInterface5ImplementationV8Internal::voidMethodMethodCallbackForMainWorl
d, 0, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 946 {"voidMethod", TestInterface5ImplementationV8Internal::voidMethodMethodCallb
ack, TestInterface5ImplementationV8Internal::voidMethodMethodCallbackForMainWorl
d, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnP
rototype}, |
| 947 {"alwaysExposedMethod", TestInterface5ImplementationV8Internal::alwaysExpose
dMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnPrototype}, | 947 {"alwaysExposedMethod", TestInterface5ImplementationV8Internal::alwaysExpose
dMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts,
V8DOMConfiguration::OnPrototype}, |
| 948 {"voidMethodBooleanOrDOMStringArg", TestInterface5ImplementationV8Internal::
voidMethodBooleanOrDOMStringArgMethodCallback, 0, 1, V8DOMConfiguration::Exposed
ToAllScripts, V8DOMConfiguration::OnPrototype}, | 948 {"alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::always
ExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedTo
AllScripts, V8DOMConfiguration::OnInterface}, |
| 949 {"voidMethodDoubleOrDOMStringArg", TestInterface5ImplementationV8Internal::v
oidMethodDoubleOrDOMStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedTo
AllScripts, V8DOMConfiguration::OnPrototype}, | 949 {"voidMethodBooleanOrDOMStringArg", TestInterface5ImplementationV8Internal::
voidMethodBooleanOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguratio
n::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 950 {"keys", TestInterface5ImplementationV8Internal::keysMethodCallback, 0, 0, V
8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 950 {"voidMethodDoubleOrDOMStringArg", TestInterface5ImplementationV8Internal::v
oidMethodDoubleOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration:
:ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 951 {"values", TestInterface5ImplementationV8Internal::valuesMethodCallback, 0,
0, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 951 {"keys", TestInterface5ImplementationV8Internal::keysMethodCallback, 0, 0, v
8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototyp
e}, |
| 952 {"entries", TestInterface5ImplementationV8Internal::entriesMethodCallback, 0
, 0, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 952 {"values", TestInterface5ImplementationV8Internal::valuesMethodCallback, 0,
0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnProt
otype}, |
| 953 {"forEach", TestInterface5ImplementationV8Internal::forEachMethodCallback, 0
, 1, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, | 953 {"entries", TestInterface5ImplementationV8Internal::entriesMethodCallback, 0
, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr
ototype}, |
| 954 {"forEach", TestInterface5ImplementationV8Internal::forEachMethodCallback, 0
, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPr
ototype}, |
| 955 {"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback,
0, 0, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::Exp
osedToAllScripts, V8DOMConfiguration::OnPrototype}, |
| 954 }; | 956 }; |
| 955 | 957 |
| 956 static void installV8TestInterface5Template(v8::Local<v8::FunctionTemplate> func
tionTemplate, v8::Isolate* isolate) | 958 static void installV8TestInterface5Template(v8::Local<v8::FunctionTemplate> func
tionTemplate, v8::Isolate* isolate) |
| 957 { | 959 { |
| 958 functionTemplate->ReadOnlyPrototype(); | 960 functionTemplate->ReadOnlyPrototype(); |
| 959 | 961 |
| 960 v8::Local<v8::Signature> defaultSignature; | 962 v8::Local<v8::Signature> defaultSignature; |
| 961 if (!RuntimeEnabledFeatures::featureNameEnabled()) | 963 if (!RuntimeEnabledFeatures::featureNameEnabled()) |
| 962 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate,
functionTemplate, "TestInterface5", V8TestInterfaceEmpty::domTemplate(isolate),
V8TestInterface5::internalFieldCount, 0, 0, 0, 0, 0, 0); | 964 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate,
functionTemplate, "TestInterface5", V8TestInterfaceEmpty::domTemplate(isolate),
V8TestInterface5::internalFieldCount, 0, 0, 0, 0, 0, 0); |
| 963 else | 965 else |
| 964 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate,
functionTemplate, "TestInterface5", V8TestInterfaceEmpty::domTemplate(isolate),
V8TestInterface5::internalFieldCount, | 966 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate,
functionTemplate, "TestInterface5", V8TestInterfaceEmpty::domTemplate(isolate),
V8TestInterface5::internalFieldCount, |
| 965 V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5Attribu
tes), | 967 V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5Attribu
tes), |
| 966 V8TestInterface5Accessors, WTF_ARRAY_LENGTH(V8TestInterface5Accessor
s), | 968 V8TestInterface5Accessors, WTF_ARRAY_LENGTH(V8TestInterface5Accessor
s), |
| 967 V8TestInterface5Methods, WTF_ARRAY_LENGTH(V8TestInterface5Methods)); | 969 V8TestInterface5Methods, WTF_ARRAY_LENGTH(V8TestInterface5Methods)); |
| 968 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 970 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
| 969 ALLOW_UNUSED_LOCAL(instanceTemplate); | 971 ALLOW_UNUSED_LOCAL(instanceTemplate); |
| 970 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 972 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
| 971 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 973 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 972 ExecutionContext* context = currentExecutionContext(isolate); | |
| 973 ALLOW_UNUSED_LOCAL(context); | |
| 974 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[]
= { | 974 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[]
= { |
| 975 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}, | 975 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}, |
| 976 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort}, | 976 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort}, |
| 977 }; | 977 }; |
| 978 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem
plate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants)); | 978 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem
plate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants)); |
| 979 { | 979 { |
| 980 v8::IndexedPropertyHandlerConfiguration config(TestInterface5Implementat
ionV8Internal::indexedPropertyGetterCallback, TestInterface5ImplementationV8Inte
rnal::indexedPropertySetterCallback, 0, TestInterface5ImplementationV8Internal::
indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface5Implemen
tation>); | 980 v8::IndexedPropertyHandlerConfiguration config(TestInterface5Implementat
ionV8Internal::indexedPropertyGetterCallback, TestInterface5ImplementationV8Inte
rnal::indexedPropertySetterCallback, 0, TestInterface5ImplementationV8Internal::
indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface5Implemen
tation>); |
| 981 functionTemplate->InstanceTemplate()->SetHandler(config); | 981 functionTemplate->InstanceTemplate()->SetHandler(config); |
| 982 } | 982 } |
| 983 { | 983 { |
| 984 int flags = static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStr
ings); | 984 int flags = static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStr
ings); |
| 985 flags |= static_cast<int>(v8::PropertyHandlerFlags::kNonMasking); | 985 flags |= static_cast<int>(v8::PropertyHandlerFlags::kNonMasking); |
| 986 v8::NamedPropertyHandlerConfiguration config(TestInterface5Implementatio
nV8Internal::namedPropertyGetterCallback, TestInterface5ImplementationV8Internal
::namedPropertySetterCallback, TestInterface5ImplementationV8Internal::namedProp
ertyQueryCallback, TestInterface5ImplementationV8Internal::namedPropertyDeleterC
allback, TestInterface5ImplementationV8Internal::namedPropertyEnumeratorCallback
, v8::Handle<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(flags)); | 986 v8::NamedPropertyHandlerConfiguration config(TestInterface5Implementatio
nV8Internal::namedPropertyGetterCallback, TestInterface5ImplementationV8Internal
::namedPropertySetterCallback, TestInterface5ImplementationV8Internal::namedProp
ertyQueryCallback, TestInterface5ImplementationV8Internal::namedPropertyDeleterC
allback, TestInterface5ImplementationV8Internal::namedPropertyEnumeratorCallback
, v8::Handle<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(flags)); |
| 987 functionTemplate->InstanceTemplate()->SetHandler(config); | 987 functionTemplate->InstanceTemplate()->SetHandler(config); |
| 988 } | 988 } |
| 989 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIterator
Configuration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Interna
l::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts, V8DOMConf
iguration::OnPrototype }; | 989 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIterator
Configuration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Interna
l::iteratorMethodCallback, 0, v8::DontDelete, V8DOMConfiguration::ExposedToAllSc
ripts, V8DOMConfiguration::OnPrototype }; |
| 990 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu
re, v8::DontDelete, symbolKeyedIteratorConfiguration); | 990 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu
re, symbolKeyedIteratorConfiguration); |
| 991 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
ce5::legacyCallCustom); | 991 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
ce5::legacyCallCustom); |
| 992 const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMethodMetho
dConfiguration = {"alwaysExposedStaticMethod", TestInterface5ImplementationV8Int
ernal::alwaysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::Expose
dToAllScripts, V8DOMConfiguration::OnInterface}; | |
| 993 V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTempla
te, functionTemplate, defaultSignature, v8::None, alwaysExposedStaticMethodMetho
dConfiguration); | |
| 994 if (context && (context->isWorkerGlobalScope())) { | |
| 995 const V8DOMConfiguration::MethodConfiguration workerExposedStaticMethodM
ethodConfiguration = {"workerExposedStaticMethod", TestInterface5ImplementationV
8Internal::workerExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::Ex
posedToAllScripts, V8DOMConfiguration::OnInterface}; | |
| 996 V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTe
mplate, functionTemplate, defaultSignature, v8::None, workerExposedStaticMethodM
ethodConfiguration); | |
| 997 } | |
| 998 if (context && (context->isDocument())) { | |
| 999 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM
ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV
8Internal::windowExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::Ex
posedToAllScripts, V8DOMConfiguration::OnInterface}; | |
| 1000 V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTe
mplate, functionTemplate, defaultSignature, v8::None, windowExposedStaticMethodM
ethodConfiguration); | |
| 1001 } | |
| 1002 const V8DOMConfiguration::MethodConfiguration toStringMethodConfiguration =
{"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback, 0,
0, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}; | |
| 1003 V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTempla
te, functionTemplate, defaultSignature, static_cast<v8::PropertyAttribute>(v8::D
ontEnum), toStringMethodConfiguration); | |
| 1004 | 992 |
| 1005 // Custom toString template | 993 // Custom toString template |
| 1006 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 994 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
| 1007 } | 995 } |
| 1008 | 996 |
| 1009 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola
te) | 997 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola
te) |
| 1010 { | 998 { |
| 1011 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterface5Template); | 999 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterface5Template); |
| 1012 } | 1000 } |
| 1013 | 1001 |
| 1014 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is
olate) | 1002 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is
olate) |
| 1015 { | 1003 { |
| 1016 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 1004 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
| 1017 } | 1005 } |
| 1018 | 1006 |
| 1019 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v
8::Value> v8Value, v8::Isolate* isolate) | 1007 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v
8::Value> v8Value, v8::Isolate* isolate) |
| 1020 { | 1008 { |
| 1021 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 1009 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 1022 } | 1010 } |
| 1023 | 1011 |
| 1024 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate*
isolate, v8::Local<v8::Value> value) | 1012 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate*
isolate, v8::Local<v8::Value> value) |
| 1025 { | 1013 { |
| 1026 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 1014 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
| 1027 } | 1015 } |
| 1028 | 1016 |
| 1029 void V8TestInterface5::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8
::Object> prototypeObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) | 1017 void V8TestInterface5::preparePrototypeAndInterfaceObject(v8::Isolate* isolate,
v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject,
v8::Local<v8::FunctionTemplate> interfaceTemplate) |
| 1030 { | 1018 { |
| 1031 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); | 1019 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); |
| 1032 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); | 1020 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe
mplate); |
| 1033 if (context && (context->isWorkerGlobalScope())) { | 1021 if (context && (context->isWorkerGlobalScope())) { |
| 1034 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =
{"workerExposedAttribute", TestInterface5ImplementationV8Internal::workerExposed
AttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::worker
ExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::P
ropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnPrototype, V8DOMConfiguration::CheckHolder}; | 1022 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =
{"workerExposedAttribute", TestInterface5ImplementationV8Internal::workerExposed
AttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::worker
ExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::P
ropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
| 1035 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), pr
ototypeObject, v8::Local<v8::Function>(), signature, accessorConfiguration); | 1023 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), pr
ototypeObject, interfaceObject, signature, accessorConfiguration); |
| 1036 } | 1024 } |
| 1037 if (context && (context->isDocument())) { | 1025 if (context && (context->isDocument())) { |
| 1038 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =
{"windowExposedAttribute", TestInterface5ImplementationV8Internal::windowExposed
AttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::window
ExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::P
ropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnPrototype, V8DOMConfiguration::CheckHolder}; | 1026 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =
{"windowExposedAttribute", TestInterface5ImplementationV8Internal::windowExposed
AttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::window
ExposedAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::P
ropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfi
guration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
| 1039 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), pr
ototypeObject, v8::Local<v8::Function>(), signature, accessorConfiguration); | 1027 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), pr
ototypeObject, interfaceObject, signature, accessorConfiguration); |
| 1040 } | 1028 } |
| 1041 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate)); | 1029 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate)); |
| 1042 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); | 1030 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont
ext()); |
| 1043 ASSERT(context); | 1031 ASSERT(context); |
| 1044 if (context && (context->isWorkerGlobalScope())) { | 1032 if (context && (context->isWorkerGlobalScope())) { |
| 1045 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate:
:New(isolate, TestInterface5ImplementationV8Internal::workerExposedMethodMethodC
allback, v8Undefined(), defaultSignature, 0); | 1033 const V8DOMConfiguration::MethodConfiguration workerExposedMethodMethodC
onfiguration = {"workerExposedMethod", TestInterface5ImplementationV8Internal::w
orkerExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToA
llScripts, V8DOMConfiguration::OnPrototype}; |
| 1046 v8::Local<v8::Function> function = v8CallOrCrash(functionTemplate->GetFu
nction(isolate->GetCurrentContext())); | 1034 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prot
otypeObject, interfaceObject, defaultSignature, workerExposedMethodMethodConfigu
ration); |
| 1047 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8Atomi
cString(isolate, "workerExposedMethod"), function)); | |
| 1048 } | 1035 } |
| 1049 if (context && (context->isDocument())) { | 1036 if (context && (context->isDocument())) { |
| 1050 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate:
:New(isolate, TestInterface5ImplementationV8Internal::windowExposedMethodMethodC
allback, v8Undefined(), defaultSignature, 0); | 1037 const V8DOMConfiguration::MethodConfiguration windowExposedMethodMethodC
onfiguration = {"windowExposedMethod", TestInterface5ImplementationV8Internal::w
indowExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToA
llScripts, V8DOMConfiguration::OnPrototype}; |
| 1051 v8::Local<v8::Function> function = v8CallOrCrash(functionTemplate->GetFu
nction(isolate->GetCurrentContext())); | 1038 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prot
otypeObject, interfaceObject, defaultSignature, windowExposedMethodMethodConfigu
ration); |
| 1052 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8Atomi
cString(isolate, "windowExposedMethod"), function)); | 1039 } |
| 1040 if (context && (context->isWorkerGlobalScope())) { |
| 1041 const V8DOMConfiguration::MethodConfiguration workerExposedStaticMethodM
ethodConfiguration = {"workerExposedStaticMethod", TestInterface5ImplementationV
8Internal::workerExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; |
| 1042 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prot
otypeObject, interfaceObject, defaultSignature, workerExposedStaticMethodMethodC
onfiguration); |
| 1043 } |
| 1044 if (context && (context->isDocument())) { |
| 1045 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodM
ethodConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV
8Internal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnInterface}; |
| 1046 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prot
otypeObject, interfaceObject, defaultSignature, windowExposedStaticMethodMethodC
onfiguration); |
| 1053 } | 1047 } |
| 1054 if (context && (context->isDocument() || context->isServiceWorkerGlobalScope
())) { | 1048 if (context && (context->isDocument() || context->isServiceWorkerGlobalScope
())) { |
| 1055 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate:
:New(isolate, TestInterface5ImplementationV8Internal::windowAndServiceWorkerExpo
sedMethodMethodCallback, v8Undefined(), defaultSignature, 0); | 1049 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo
sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter
face5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback
, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::O
nPrototype}; |
| 1056 v8::Local<v8::Function> function = v8CallOrCrash(functionTemplate->GetFu
nction(isolate->GetCurrentContext())); | 1050 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prot
otypeObject, interfaceObject, defaultSignature, windowAndServiceWorkerExposedMet
hodMethodConfiguration); |
| 1057 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8Atomi
cString(isolate, "windowAndServiceWorkerExposedMethod"), function)); | |
| 1058 } | 1051 } |
| 1059 } | 1052 } |
| 1060 | 1053 |
| 1061 ActiveDOMObject* V8TestInterface5::toActiveDOMObject(v8::Local<v8::Object> wrapp
er) | 1054 ActiveDOMObject* V8TestInterface5::toActiveDOMObject(v8::Local<v8::Object> wrapp
er) |
| 1062 { | 1055 { |
| 1063 return toImpl(wrapper); | 1056 return toImpl(wrapper); |
| 1064 } | 1057 } |
| 1065 | 1058 |
| 1066 void V8TestInterface5::refObject(ScriptWrappable* scriptWrappable) | 1059 void V8TestInterface5::refObject(ScriptWrappable* scriptWrappable) |
| 1067 { | 1060 { |
| 1068 scriptWrappable->toImpl<TestInterface5Implementation>()->ref(); | 1061 scriptWrappable->toImpl<TestInterface5Implementation>()->ref(); |
| 1069 } | 1062 } |
| 1070 | 1063 |
| 1071 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable) | 1064 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable) |
| 1072 { | 1065 { |
| 1073 scriptWrappable->toImpl<TestInterface5Implementation>()->deref(); | 1066 scriptWrappable->toImpl<TestInterface5Implementation>()->deref(); |
| 1074 } | 1067 } |
| 1075 | 1068 |
| 1076 } // namespace blink | 1069 } // namespace blink |
| 1077 #endif // ENABLE(CONDITION) | 1070 #endif // ENABLE(CONDITION) |
| OLD | NEW |