| OLD | NEW |
| 1 /* | 1 /* |
| 2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
| 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
| 4 | 4 |
| 5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
| 6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
| 7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
| 8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
| 9 | 9 |
| 10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "platform/TraceEvent.h" | 64 #include "platform/TraceEvent.h" |
| 65 #include "wtf/GetPtr.h" | 65 #include "wtf/GetPtr.h" |
| 66 #include "wtf/RefPtr.h" | 66 #include "wtf/RefPtr.h" |
| 67 #include "wtf/UnusedParam.h" | 67 #include "wtf/UnusedParam.h" |
| 68 | 68 |
| 69 namespace WebCore { | 69 namespace WebCore { |
| 70 | 70 |
| 71 static void initializeScriptWrappableForInterface(TestObj* object) | 71 static void initializeScriptWrappableForInterface(TestObj* object) |
| 72 { | 72 { |
| 73 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 73 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 74 ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::info); | 74 ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeI
nfo); |
| 75 else | 75 else |
| 76 ASSERT_NOT_REACHED(); | 76 ASSERT_NOT_REACHED(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace WebCore | 79 } // namespace WebCore |
| 80 | 80 |
| 81 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 81 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
| 82 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 82 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
| 83 // in the global namespace. | 83 // in the global namespace. |
| 84 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 84 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
| 85 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object) | 85 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object) |
| 86 { | 86 { |
| 87 WebCore::initializeScriptWrappableForInterface(object); | 87 WebCore::initializeScriptWrappableForInterface(object); |
| 88 } | 88 } |
| 89 | 89 |
| 90 namespace WebCore { | 90 namespace WebCore { |
| 91 WrapperTypeInfo V8TestObject::info = { V8TestObject::GetTemplate, V8TestObject::
derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextE
nabledPrototypeProperties, &V8EventTarget::info, WrapperTypeObjectPrototype }; | 91 WrapperTypeInfo V8TestObject::wrapperTypeInfo = { V8TestObject::GetTemplate, V8T
estObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::install
PerContextEnabledPrototypeProperties, &V8EventTarget::wrapperTypeInfo, WrapperTy
peObjectPrototype }; |
| 92 | 92 |
| 93 namespace TestObjV8Internal { | 93 namespace TestObjV8Internal { |
| 94 | 94 |
| 95 template <typename T> void V8_USE(T) { } | 95 template <typename T> void V8_USE(T) { } |
| 96 | 96 |
| 97 static void readOnlyLongAttrAttributeGetter(v8::Local<v8::String> name, const v8
::PropertyCallbackInfo<v8::Value>& info) | 97 static void readOnlyLongAttrAttributeGetter(v8::Local<v8::String> name, const v8
::PropertyCallbackInfo<v8::Value>& info) |
| 98 { | 98 { |
| 99 TestObj* imp = V8TestObject::toNative(info.Holder()); | 99 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 100 v8SetReturnValueInt(info, imp->readOnlyLongAttr()); | 100 v8SetReturnValueInt(info, imp->readOnlyLongAttr()); |
| 101 } | 101 } |
| (...skipping 4955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5057 } | 5057 } |
| 5058 if (args.Length() <= 0 || !args[0]->IsFunction()) { | 5058 if (args.Length() <= 0 || !args[0]->IsFunction()) { |
| 5059 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), args.GetIsola
te()); | 5059 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestOb
ject", "The callback provided as parameter 1 is not a function."), args.GetIsola
te()); |
| 5060 return; | 5060 return; |
| 5061 } | 5061 } |
| 5062 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getExecu
tionContext()); | 5062 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[0], getExecu
tionContext()); |
| 5063 | 5063 |
| 5064 RefPtr<TestObj> impl = TestObj::create(testCallback); | 5064 RefPtr<TestObj> impl = TestObj::create(testCallback); |
| 5065 v8::Handle<v8::Object> wrapper = args.Holder(); | 5065 v8::Handle<v8::Object> wrapper = args.Holder(); |
| 5066 | 5066 |
| 5067 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te
stObject::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); | 5067 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8Te
stObject::wrapperTypeInfo, wrapper, args.GetIsolate(), WrapperConfiguration::Dep
endent); |
| 5068 args.GetReturnValue().Set(wrapper); | 5068 args.GetReturnValue().Set(wrapper); |
| 5069 } | 5069 } |
| 5070 | 5070 |
| 5071 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 5071 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 5072 { | 5072 { |
| 5073 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); | 5073 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
| 5074 TestObj* collection = V8TestObject::toNative(info.Holder()); | 5074 TestObj* collection = V8TestObject::toNative(info.Holder()); |
| 5075 RefPtr<Node> element = collection->item(index); | 5075 RefPtr<Node> element = collection->item(index); |
| 5076 if (!element) | 5076 if (!element) |
| 5077 return; | 5077 return; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5203 #if ENABLE(Condition1) | 5203 #if ENABLE(Condition1) |
| 5204 {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, | 5204 {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, |
| 5205 #endif // ENABLE(Condition1) | 5205 #endif // ENABLE(Condition1) |
| 5206 #if ENABLE(Condition1) && ENABLE(Condition2) | 5206 #if ENABLE(Condition1) && ENABLE(Condition2) |
| 5207 {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, | 5207 {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, |
| 5208 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 5208 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| 5209 #if ENABLE(Condition1) || ENABLE(Condition2) | 5209 #if ENABLE(Condition1) || ENABLE(Condition2) |
| 5210 {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, | 5210 {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttributeGetterCallb
ack, TestObjV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, |
| 5211 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 5211 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| 5212 #if ENABLE(Condition1) | 5212 #if ENABLE(Condition1) |
| 5213 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, &V8TestObjectectA::inf
o, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::DontEnum), 0 /* on instance */}, | 5213 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, &V8TestObjectectA::wra
pperTypeInfo, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope
rtyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| 5214 #endif // ENABLE(Condition1) | 5214 #endif // ENABLE(Condition1) |
| 5215 #if ENABLE(Condition1) && ENABLE(Condition2) | 5215 #if ENABLE(Condition1) && ENABLE(Condition2) |
| 5216 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, &V8TestObjectectB::inf
o, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::DontEnum), 0 /* on instance */}, | 5216 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, &V8TestObjectectB::wra
pperTypeInfo, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope
rtyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| 5217 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 5217 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| 5218 #if ENABLE(Condition1) || ENABLE(Condition2) | 5218 #if ENABLE(Condition1) || ENABLE(Condition2) |
| 5219 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, &V8TestObjectectC::inf
o, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::DontEnum), 0 /* on instance */}, | 5219 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8I
nternal::TestObjReplaceableAttributeSetterCallback, 0, 0, &V8TestObjectectC::wra
pperTypeInfo, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prope
rtyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| 5220 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 5220 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| 5221 {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | 5221 {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, |
| 5222 {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, | 5222 {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttributeGetterCallb
ack, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr
opertyAttribute>(v8::None), 0 /* on instance */}, |
| 5223 {"anyAttribute", TestObjV8Internal::anyAttributeAttributeGetterCallback, Tes
tObjV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Ac
cessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, | 5223 {"anyAttribute", TestObjV8Internal::anyAttributeAttributeGetterCallback, Tes
tObjV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Ac
cessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, |
| 5224 {"callbackFunctionAttribute", TestObjV8Internal::callbackFunctionAttributeAt
tributeGetterCallback, TestObjV8Internal::callbackFunctionAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, | 5224 {"callbackFunctionAttribute", TestObjV8Internal::callbackFunctionAttributeAt
tributeGetterCallback, TestObjV8Internal::callbackFunctionAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 5225 {"floatArray", TestObjV8Internal::floatArrayAttributeGetterCallback, TestObj
V8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCo
ntrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on insta
nce */}, | 5225 {"floatArray", TestObjV8Internal::floatArrayAttributeGetterCallback, TestObj
V8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCo
ntrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on insta
nce */}, |
| 5226 {"doubleArray", TestObjV8Internal::doubleArrayAttributeGetterCallback, TestO
bjV8Internal::doubleArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acces
sControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on in
stance */}, | 5226 {"doubleArray", TestObjV8Internal::doubleArrayAttributeGetterCallback, TestO
bjV8Internal::doubleArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acces
sControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on in
stance */}, |
| 5227 {"messagePortArray", TestObjV8Internal::messagePortArrayAttributeGetterCallb
ack, TestObjV8Internal::messagePortArrayAttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, | 5227 {"messagePortArray", TestObjV8Internal::messagePortArrayAttributeGetterCallb
ack, TestObjV8Internal::messagePortArrayAttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}, |
| 5228 {"contentDocument", TestObjV8Internal::contentDocumentAttributeGetterCallbac
k, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop
ertyAttribute>(v8::None), 0 /* on instance */}, | 5228 {"contentDocument", TestObjV8Internal::contentDocumentAttributeGetterCallbac
k, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Prop
ertyAttribute>(v8::None), 0 /* on instance */}, |
| 5229 {"mutablePoint", TestObjV8Internal::mutablePointAttributeGetterCallback, Tes
tObjV8Internal::mutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::Ac
cessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, | 5229 {"mutablePoint", TestObjV8Internal::mutablePointAttributeGetterCallback, Tes
tObjV8Internal::mutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::Ac
cessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5368 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants
[] = { | 5368 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants
[] = { |
| 5369 {"DEPRECATED_CONSTANT", 1}, | 5369 {"DEPRECATED_CONSTANT", 1}, |
| 5370 }; | 5370 }; |
| 5371 V8DOMConfiguration::installConstants(desc, proto, V8TestObjectConstants, WTF
_ARRAY_LENGTH(V8TestObjectConstants), isolate); | 5371 V8DOMConfiguration::installConstants(desc, proto, V8TestObjectConstants, WTF
_ARRAY_LENGTH(V8TestObjectConstants), isolate); |
| 5372 COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TheValueOfTestObj_DEPRECAT
ED_CONSTANTDoesntMatchWithImplementation); | 5372 COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TheValueOfTestObj_DEPRECAT
ED_CONSTANTDoesntMatchWithImplementation); |
| 5373 desc->InstanceTemplate()->SetIndexedPropertyHandler(TestObjV8Internal::index
edPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObj>); | 5373 desc->InstanceTemplate()->SetIndexedPropertyHandler(TestObjV8Internal::index
edPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObj>); |
| 5374 desc->InstanceTemplate()->SetNamedPropertyHandler(TestObjV8Internal::namedPr
opertyGetterCallback, 0, TestObjV8Internal::namedPropertyQueryCallback, 0, TestO
bjV8Internal::namedPropertyEnumeratorCallback); | 5374 desc->InstanceTemplate()->SetNamedPropertyHandler(TestObjV8Internal::namedPr
opertyGetterCallback, 0, TestObjV8Internal::namedPropertyQueryCallback, 0, TestO
bjV8Internal::namedPropertyEnumeratorCallback); |
| 5375 | 5375 |
| 5376 // Custom Signature 'voidMethodWithArgs' | 5376 // Custom Signature 'voidMethodWithArgs' |
| 5377 const int voidMethodWithArgsArgc = 3; | 5377 const int voidMethodWithArgsArgc = 3; |
| 5378 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::info, currentWorldTy
pe) }; | 5378 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, cur
rentWorldType) }; |
| 5379 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(d
esc, voidMethodWithArgsArgc, voidMethodWithArgsArgv); | 5379 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(d
esc, voidMethodWithArgsArgc, voidMethodWithArgsArgv); |
| 5380 proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMe
thodWithArgsSignature, 3)); | 5380 proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMe
thodWithArgsSignature, 3)); |
| 5381 | 5381 |
| 5382 // Custom Signature 'longMethodWithArgs' | 5382 // Custom Signature 'longMethodWithArgs' |
| 5383 const int longMethodWithArgsArgc = 3; | 5383 const int longMethodWithArgsArgc = 3; |
| 5384 v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::info, currentWorldTy
pe) }; | 5384 v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsAr
gc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(),
V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, cur
rentWorldType) }; |
| 5385 v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(d
esc, longMethodWithArgsArgc, longMethodWithArgsArgv); | 5385 v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(d
esc, longMethodWithArgsArgc, longMethodWithArgsArgv); |
| 5386 proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMe
thodWithArgsSignature, 3)); | 5386 proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate
::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMe
thodWithArgsSignature, 3)); |
| 5387 | 5387 |
| 5388 // Custom Signature 'objMethodWithArgs' | 5388 // Custom Signature 'objMethodWithArgs' |
| 5389 const int objMethodWithArgsArgc = 3; | 5389 const int objMethodWithArgsArgc = 3; |
| 5390 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc
] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8
PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::info, currentWorldType
) }; | 5390 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc
] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8
PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, curre
ntWorldType) }; |
| 5391 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(de
sc, objMethodWithArgsArgc, objMethodWithArgsArgv); | 5391 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(de
sc, objMethodWithArgsArgc, objMethodWithArgsArgv); |
| 5392 proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate:
:New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMetho
dWithArgsSignature, 3)); | 5392 proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate:
:New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMetho
dWithArgsSignature, 3)); |
| 5393 | 5393 |
| 5394 // Custom Signature 'methodThatRequiresAllArgsAndThrows' | 5394 // Custom Signature 'methodThatRequiresAllArgsAndThrows' |
| 5395 const int methodThatRequiresAllArgsAndThrowsArgc = 2; | 5395 const int methodThatRequiresAllArgsAndThrowsArgc = 2; |
| 5396 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[meth
odThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8Pe
rIsolateData::from(isolate)->rawTemplate(&V8TestObject::info, currentWorldType)
}; | 5396 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[meth
odThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8Pe
rIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, current
WorldType) }; |
| 5397 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::
Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresA
llArgsAndThrowsArgv); | 5397 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::
Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresA
llArgsAndThrowsArgv); |
| 5398 proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::
FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMetho
dCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2)); | 5398 proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::
FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMetho
dCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2)); |
| 5399 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v
8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalA
rgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); | 5399 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v
8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalA
rgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| 5400 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::Function
Template::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Un
defined(), v8::Local<v8::Signature>(), 1)); | 5400 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::Function
Template::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Un
defined(), v8::Local<v8::Signature>(), 1)); |
| 5401 desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(Te
stObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signatu
re>(), 0)); | 5401 desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(Te
stObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signatu
re>(), 0)); |
| 5402 desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemp
late::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(
), v8::Local<v8::Signature>(), 0)); | 5402 desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemp
late::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(
), v8::Local<v8::Signature>(), 0)); |
| 5403 desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(T
estObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signa
ture>(), 1)); | 5403 desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(T
estObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signa
ture>(), 1)); |
| 5404 #if ENABLE(Condition1) | 5404 #if ENABLE(Condition1) |
| 5405 desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::
New(TestObjV8Internal::overloadedMethod1MethodCallback, v8Undefined(), v8::Local
<v8::Signature>(), 1)); | 5405 desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::
New(TestObjV8Internal::overloadedMethod1MethodCallback, v8Undefined(), v8::Local
<v8::Signature>(), 1)); |
| 5406 #endif // ENABLE(Condition1) | 5406 #endif // ENABLE(Condition1) |
| 5407 if (RuntimeEnabledFeatures::featureNameEnabled()) | 5407 if (RuntimeEnabledFeatures::featureNameEnabled()) |
| 5408 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod"), v8::Function
Template::New(TestObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefin
ed(), defaultSignature, 1)); | 5408 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod"), v8::Function
Template::New(TestObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefin
ed(), defaultSignature, 1)); |
| 5409 | 5409 |
| 5410 // Custom Signature 'domStringListFunction' | 5410 // Custom Signature 'domStringListFunction' |
| 5411 const int domStringListFunctionArgc = 1; | 5411 const int domStringListFunctionArgc = 1; |
| 5412 v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunc
tionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::inf
o, currentWorldType) }; | 5412 v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunc
tionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::wra
pperTypeInfo, currentWorldType) }; |
| 5413 v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::Ne
w(desc, domStringListFunctionArgc, domStringListFunctionArgv); | 5413 v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::Ne
w(desc, domStringListFunctionArgc, domStringListFunctionArgv); |
| 5414 proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTempl
ate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(),
domStringListFunctionSignature, 1)); | 5414 proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTempl
ate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(),
domStringListFunctionSignature, 1)); |
| 5415 | 5415 |
| 5416 // Custom Signature 'convert1' | 5416 // Custom Signature 'convert1' |
| 5417 const int convert1Argc = 1; | 5417 const int convert1Argc = 1; |
| 5418 v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | 5418 v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType)
}; |
| 5419 v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, conve
rt1Argc, convert1Argv); | 5419 v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, conve
rt1Argc, convert1Argv); |
| 5420 proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1)); | 5420 proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1)); |
| 5421 | 5421 |
| 5422 // Custom Signature 'convert2' | 5422 // Custom Signature 'convert2' |
| 5423 const int convert2Argc = 1; | 5423 const int convert2Argc = 1; |
| 5424 v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | 5424 v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType)
}; |
| 5425 v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, conve
rt2Argc, convert2Argv); | 5425 v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, conve
rt2Argc, convert2Argv); |
| 5426 proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1)); | 5426 proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1)); |
| 5427 | 5427 |
| 5428 // Custom Signature 'convert4' | 5428 // Custom Signature 'convert4' |
| 5429 const int convert4Argc = 1; | 5429 const int convert4Argc = 1; |
| 5430 v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | 5430 v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType)
}; |
| 5431 v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, conve
rt4Argc, convert4Argv); | 5431 v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, conve
rt4Argc, convert4Argv); |
| 5432 proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert4MethodCallback, v8Undefined(), convert4Signature, 1)); | 5432 proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert4MethodCallback, v8Undefined(), convert4Signature, 1)); |
| 5433 | 5433 |
| 5434 // Custom Signature 'convert5' | 5434 // Custom Signature 'convert5' |
| 5435 const int convert5Argc = 1; | 5435 const int convert5Argc = 1; |
| 5436 v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::info, currentWorldType) }; | 5436 v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8PerIsolate
Data::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType)
}; |
| 5437 v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, conve
rt5Argc, convert5Argv); | 5437 v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, conve
rt5Argc, convert5Argv); |
| 5438 proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert5MethodCallback, v8Undefined(), convert5Signature, 1)); | 5438 proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(Test
ObjV8Internal::convert5MethodCallback, v8Undefined(), convert5Signature, 1)); |
| 5439 | 5439 |
| 5440 // Custom Signature 'svgPointMethod' | 5440 // Custom Signature 'svgPointMethod' |
| 5441 const int svgPointMethodArgc = 2; | 5441 const int svgPointMethodArgc = 2; |
| 5442 v8::Handle<v8::FunctionTemplate> svgPointMethodArgv[svgPointMethodArgc] = {
V8PerIsolateData::from(isolate)->rawTemplate(&V8SVGPoint::info, currentWorldType
), v8::Handle<v8::FunctionTemplate>() }; | 5442 v8::Handle<v8::FunctionTemplate> svgPointMethodArgv[svgPointMethodArgc] = {
V8PerIsolateData::from(isolate)->rawTemplate(&V8SVGPoint::wrapperTypeInfo, curre
ntWorldType), v8::Handle<v8::FunctionTemplate>() }; |
| 5443 v8::Handle<v8::Signature> svgPointMethodSignature = v8::Signature::New(desc,
svgPointMethodArgc, svgPointMethodArgv); | 5443 v8::Handle<v8::Signature> svgPointMethodSignature = v8::Signature::New(desc,
svgPointMethodArgc, svgPointMethodArgv); |
| 5444 proto->Set(v8::String::NewSymbol("svgPointMethod"), v8::FunctionTemplate::Ne
w(TestObjV8Internal::svgPointMethodMethodCallback, v8Undefined(), svgPointMethod
Signature, 2)); | 5444 proto->Set(v8::String::NewSymbol("svgPointMethod"), v8::FunctionTemplate::Ne
w(TestObjV8Internal::svgPointMethodMethodCallback, v8Undefined(), svgPointMethod
Signature, 2)); |
| 5445 | 5445 |
| 5446 // Custom Signature 'variadicNodeMethod' | 5446 // Custom Signature 'variadicNodeMethod' |
| 5447 const int variadicNodeMethodArgc = 2; | 5447 const int variadicNodeMethodArgc = 2; |
| 5448 v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodAr
gc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorld
Type), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, currentWorldT
ype) }; | 5448 v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodAr
gc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, c
urrentWorldType), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperT
ypeInfo, currentWorldType) }; |
| 5449 v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(d
esc, variadicNodeMethodArgc, variadicNodeMethodArgv); | 5449 v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(d
esc, variadicNodeMethodArgc, variadicNodeMethodArgv); |
| 5450 proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate
::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variad
icNodeMethodSignature, 2)); | 5450 proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate
::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variad
icNodeMethodSignature, 2)); |
| 5451 desc->Set(v8::String::NewSymbol("deprecatedStaticMethod"), v8::FunctionTempl
ate::New(TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(),
v8::Local<v8::Signature>(), 0)); | 5451 desc->Set(v8::String::NewSymbol("deprecatedStaticMethod"), v8::FunctionTempl
ate::New(TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(),
v8::Local<v8::Signature>(), 0)); |
| 5452 desc->SetNativeDataProperty(v8::String::NewSymbol("staticReadOnlyLongAttr"),
TestObjV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::Extern
al::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::Accesso
rSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 5452 desc->SetNativeDataProperty(v8::String::NewSymbol("staticReadOnlyLongAttr"),
TestObjV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::Extern
al::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::Accesso
rSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| 5453 desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttr"), TestO
bjV8Internal::staticStringAttrAttributeGetterCallback, TestObjV8Internal::static
StringAttrAttributeSetterCallback, v8::External::New(0), static_cast<v8::Propert
yAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Acce
ssControl>(v8::DEFAULT)); | 5453 desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttr"), TestO
bjV8Internal::staticStringAttrAttributeGetterCallback, TestObjV8Internal::static
StringAttrAttributeSetterCallback, v8::External::New(0), static_cast<v8::Propert
yAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Acce
ssControl>(v8::DEFAULT)); |
| 5454 desc->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestObjV8In
ternal::TestObjConstructorGetter, 0, v8::External::New(&V8TestSubObj::info), sta
tic_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>
(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 5454 desc->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestObjV8In
ternal::TestObjConstructorGetter, 0, v8::External::New(&V8TestSubObj::wrapperTyp
eInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::Accesso
rSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| 5455 desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticReadOnlyA
ttr"), TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0
, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle
<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 5455 desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticReadOnlyA
ttr"), TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0
, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle
<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| 5456 desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticAttr"), T
estObjV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjV8Internal
::deprecatedStaticAttrAttributeSetterCallback, v8::External::New(0), static_cast
<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_c
ast<v8::AccessControl>(v8::DEFAULT)); | 5456 desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticAttr"), T
estObjV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjV8Internal
::deprecatedStaticAttrAttributeSetterCallback, v8::External::New(0), static_cast
<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_c
ast<v8::AccessControl>(v8::DEFAULT)); |
| 5457 | 5457 |
| 5458 // Custom toString template | 5458 // Custom toString template |
| 5459 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 5459 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
| 5460 return desc; | 5460 return desc; |
| 5461 } | 5461 } |
| 5462 | 5462 |
| 5463 v8::Handle<v8::FunctionTemplate> V8TestObject::GetTemplate(v8::Isolate* isolate,
WrapperWorldType currentWorldType) | 5463 v8::Handle<v8::FunctionTemplate> V8TestObject::GetTemplate(v8::Isolate* isolate,
WrapperWorldType currentWorldType) |
| 5464 { | 5464 { |
| 5465 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 5465 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 5466 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | 5466 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| 5467 if (result != data->templateMap(currentWorldType).end()) | 5467 if (result != data->templateMap(currentWorldType).end()) |
| 5468 return result->value.newLocal(isolate); | 5468 return result->value.newLocal(isolate); |
| 5469 | 5469 |
| 5470 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 5470 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 5471 v8::HandleScope handleScope(isolate); | 5471 v8::HandleScope handleScope(isolate); |
| 5472 v8::Handle<v8::FunctionTemplate> templ = | 5472 v8::Handle<v8::FunctionTemplate> templ = |
| 5473 ConfigureV8TestObjectTemplate(data->rawTemplate(&info, currentWorldType)
, isolate, currentWorldType); | 5473 ConfigureV8TestObjectTemplate(data->rawTemplate(&wrapperTypeInfo, curren
tWorldType), isolate, currentWorldType); |
| 5474 data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::Function
Template>(isolate, templ)); | 5474 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 5475 return handleScope.Close(templ); | 5475 return handleScope.Close(templ); |
| 5476 } | 5476 } |
| 5477 | 5477 |
| 5478 bool V8TestObject::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isola
te, WrapperWorldType currentWorldType) | 5478 bool V8TestObject::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isola
te, WrapperWorldType currentWorldType) |
| 5479 { | 5479 { |
| 5480 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, currentW
orldType); | 5480 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
| 5481 } | 5481 } |
| 5482 | 5482 |
| 5483 bool V8TestObject::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isol
ate* isolate) | 5483 bool V8TestObject::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isol
ate* isolate) |
| 5484 { | 5484 { |
| 5485 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, MainWorl
d) | 5485 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
| 5486 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, Isolated
World) | 5486 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
| 5487 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, WorkerWo
rld); | 5487 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
| 5488 } | 5488 } |
| 5489 | 5489 |
| 5490 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> ins
tance, TestObj* impl, v8::Isolate* isolate) | 5490 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> ins
tance, TestObj* impl, v8::Isolate* isolate) |
| 5491 { | 5491 { |
| 5492 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); | 5492 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); |
| 5493 if (ContextFeatures::featureNameEnabled(impl->document())) { | 5493 if (ContextFeatures::featureNameEnabled(impl->document())) { |
| 5494 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 5494 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 5495 {"enabledPerContextAttr", TestObjV8Internal::enabledPerContextAttrAttrib
uteGetterCallback, TestObjV8Internal::enabledPerContextAttrAttributeSetterCallba
ck, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}; | 5495 {"enabledPerContextAttr", TestObjV8Internal::enabledPerContextAttrAttrib
uteGetterCallback, TestObjV8Internal::enabledPerContextAttrAttributeSetterCallba
ck, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Proper
tyAttribute>(v8::None), 0 /* on instance */}; |
| 5496 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura
tion, isolate); | 5496 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura
tion, isolate); |
| 5497 } | 5497 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 5512 { | 5512 { |
| 5513 return toNative(object); | 5513 return toNative(object); |
| 5514 } | 5514 } |
| 5515 | 5515 |
| 5516 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) | 5516 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8:
:Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 5517 { | 5517 { |
| 5518 ASSERT(impl); | 5518 ASSERT(impl); |
| 5519 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); | 5519 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); |
| 5520 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 5520 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 5521 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 5521 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 5522 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 5522 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 5523 // the same object de-ref functions, though, so use that as the basis of
the check. | 5523 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 5524 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); | 5524 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
| 5525 } | 5525 } |
| 5526 | 5526 |
| 5527 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); | 5527 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
| 5528 if (UNLIKELY(wrapper.IsEmpty())) | 5528 if (UNLIKELY(wrapper.IsEmpty())) |
| 5529 return wrapper; | 5529 return wrapper; |
| 5530 | 5530 |
| 5531 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 5531 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
| 5532 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &info, wrapper,
isolate, WrapperConfiguration::Independent); | 5532 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf
o, wrapper, isolate, WrapperConfiguration::Independent); |
| 5533 return wrapper; | 5533 return wrapper; |
| 5534 } | 5534 } |
| 5535 | 5535 |
| 5536 void V8TestObject::derefObject(void* object) | 5536 void V8TestObject::derefObject(void* object) |
| 5537 { | 5537 { |
| 5538 fromInternalPointer(object)->deref(); | 5538 fromInternalPointer(object)->deref(); |
| 5539 } | 5539 } |
| 5540 | 5540 |
| 5541 } // namespace WebCore | 5541 } // namespace WebCore |
| OLD | NEW |