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 25 matching lines...) Expand all Loading... |
36 #include "platform/TraceEvent.h" | 36 #include "platform/TraceEvent.h" |
37 #include "wtf/GetPtr.h" | 37 #include "wtf/GetPtr.h" |
38 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
39 #include "wtf/UnusedParam.h" | 39 #include "wtf/UnusedParam.h" |
40 | 40 |
41 namespace WebCore { | 41 namespace WebCore { |
42 | 42 |
43 static void initializeScriptWrappableForInterface(SupportTestInterface* object) | 43 static void initializeScriptWrappableForInterface(SupportTestInterface* object) |
44 { | 44 { |
45 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 45 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
46 ScriptWrappable::setTypeInfoInObject(object, &V8SupportTestInterface::in
fo); | 46 ScriptWrappable::setTypeInfoInObject(object, &V8SupportTestInterface::wr
apperTypeInfo); |
47 else | 47 else |
48 ASSERT_NOT_REACHED(); | 48 ASSERT_NOT_REACHED(); |
49 } | 49 } |
50 | 50 |
51 } // namespace WebCore | 51 } // namespace WebCore |
52 | 52 |
53 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 53 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
54 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 54 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
55 // in the global namespace. | 55 // in the global namespace. |
56 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 56 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
57 void webCoreInitializeScriptWrappableForInterface(WebCore::SupportTestInterface*
object) | 57 void webCoreInitializeScriptWrappableForInterface(WebCore::SupportTestInterface*
object) |
58 { | 58 { |
59 WebCore::initializeScriptWrappableForInterface(object); | 59 WebCore::initializeScriptWrappableForInterface(object); |
60 } | 60 } |
61 | 61 |
62 namespace WebCore { | 62 namespace WebCore { |
63 WrapperTypeInfo V8SupportTestInterface::info = { V8SupportTestInterface::GetTemp
late, V8SupportTestInterface::derefObject, 0, 0, 0, V8SupportTestInterface::inst
allPerContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototype }; | 63 WrapperTypeInfo V8SupportTestInterface::wrapperTypeInfo = { V8SupportTestInterfa
ce::GetTemplate, V8SupportTestInterface::derefObject, 0, 0, 0, V8SupportTestInte
rface::installPerContextEnabledPrototypeProperties, 0, WrapperTypeObjectPrototyp
e }; |
64 | 64 |
65 namespace SupportTestInterfaceV8Internal { | 65 namespace SupportTestInterfaceV8Internal { |
66 | 66 |
67 template <typename T> void V8_USE(T) { } | 67 template <typename T> void V8_USE(T) { } |
68 | 68 |
69 #if ENABLE(Condition11) || ENABLE(Condition12) | 69 #if ENABLE(Condition11) || ENABLE(Condition12) |
70 static void supplementalStaticReadOnlyAttrAttributeGetter(v8::Local<v8::String>
name, const v8::PropertyCallbackInfo<v8::Value>& info) | 70 static void supplementalStaticReadOnlyAttrAttributeGetter(v8::Local<v8::String>
name, const v8::PropertyCallbackInfo<v8::Value>& info) |
71 { | 71 { |
72 v8SetReturnValueInt(info, SupportTestPartialInterface::supplementalStaticRea
dOnlyAttr()); | 72 v8SetReturnValueInt(info, SupportTestPartialInterface::supplementalStaticRea
dOnlyAttr()); |
73 } | 73 } |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 {"SUPPLEMENTALCONSTANT1", 1}, | 429 {"SUPPLEMENTALCONSTANT1", 1}, |
430 {"SUPPLEMENTALCONSTANT2", 2}, | 430 {"SUPPLEMENTALCONSTANT2", 2}, |
431 }; | 431 }; |
432 V8DOMConfiguration::installConstants(desc, proto, V8SupportTestInterfaceCons
tants, WTF_ARRAY_LENGTH(V8SupportTestInterfaceConstants), isolate); | 432 V8DOMConfiguration::installConstants(desc, proto, V8SupportTestInterfaceCons
tants, WTF_ARRAY_LENGTH(V8SupportTestInterfaceConstants), isolate); |
433 COMPILE_ASSERT(1 == SupportTestPartialInterface::SUPPLEMENTALCONSTANT1, TheV
alueOfSupportTestInterface_SUPPLEMENTALCONSTANT1DoesntMatchWithImplementation); | 433 COMPILE_ASSERT(1 == SupportTestPartialInterface::SUPPLEMENTALCONSTANT1, TheV
alueOfSupportTestInterface_SUPPLEMENTALCONSTANT1DoesntMatchWithImplementation); |
434 COMPILE_ASSERT(2 == SupportTestPartialInterface::CONST_IMPL, TheValueOfSuppo
rtTestInterface_CONST_IMPLDoesntMatchWithImplementation); | 434 COMPILE_ASSERT(2 == SupportTestPartialInterface::CONST_IMPL, TheValueOfSuppo
rtTestInterface_CONST_IMPLDoesntMatchWithImplementation); |
435 #if ENABLE(Condition11) || ENABLE(Condition12) | 435 #if ENABLE(Condition11) || ENABLE(Condition12) |
436 | 436 |
437 // Custom Signature 'supplementalMethod2' | 437 // Custom Signature 'supplementalMethod2' |
438 const int supplementalMethod2Argc = 2; | 438 const int supplementalMethod2Argc = 2; |
439 v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2
Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->r
awTemplate(&V8TestObject::info, currentWorldType) }; | 439 v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2
Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->r
awTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) }; |
440 v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(
desc, supplementalMethod2Argc, supplementalMethod2Argv); | 440 v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(
desc, supplementalMethod2Argc, supplementalMethod2Argv); |
441 proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplat
e::New(SupportTestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Unde
fined(), supplementalMethod2Signature, 2)); | 441 proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplat
e::New(SupportTestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Unde
fined(), supplementalMethod2Signature, 2)); |
442 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 442 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
443 #if ENABLE(Condition11) || ENABLE(Condition12) | 443 #if ENABLE(Condition11) || ENABLE(Condition12) |
444 desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate
::New(SupportTestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undef
ined(), v8::Local<v8::Signature>(), 0)); | 444 desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate
::New(SupportTestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undef
ined(), v8::Local<v8::Signature>(), 0)); |
445 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 445 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
446 #if ENABLE(Condition11) || ENABLE(Condition12) | 446 #if ENABLE(Condition11) || ENABLE(Condition12) |
447 desc->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticReadOnl
yAttr"), SupportTestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttribute
GetterCallback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::
None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::D
EFAULT)); | 447 desc->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticReadOnl
yAttr"), SupportTestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttribute
GetterCallback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::
None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::D
EFAULT)); |
448 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 448 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
449 #if ENABLE(Condition11) || ENABLE(Condition12) | 449 #if ENABLE(Condition11) || ENABLE(Condition12) |
450 desc->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticAttr"),
SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCallback,
SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v
8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8
::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | 450 desc->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticAttr"),
SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCallback,
SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v
8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8
::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
451 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 451 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
452 | 452 |
453 // Custom toString template | 453 // Custom toString template |
454 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 454 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
455 return desc; | 455 return desc; |
456 } | 456 } |
457 | 457 |
458 v8::Handle<v8::FunctionTemplate> V8SupportTestInterface::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) | 458 v8::Handle<v8::FunctionTemplate> V8SupportTestInterface::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) |
459 { | 459 { |
460 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 460 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
461 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | 461 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
462 if (result != data->templateMap(currentWorldType).end()) | 462 if (result != data->templateMap(currentWorldType).end()) |
463 return result->value.newLocal(isolate); | 463 return result->value.newLocal(isolate); |
464 | 464 |
465 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 465 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
466 v8::HandleScope handleScope(isolate); | 466 v8::HandleScope handleScope(isolate); |
467 v8::Handle<v8::FunctionTemplate> templ = | 467 v8::Handle<v8::FunctionTemplate> templ = |
468 ConfigureV8SupportTestInterfaceTemplate(data->rawTemplate(&info, current
WorldType), isolate, currentWorldType); | 468 ConfigureV8SupportTestInterfaceTemplate(data->rawTemplate(&wrapperTypeIn
fo, currentWorldType), isolate, currentWorldType); |
469 data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::Function
Template>(isolate, templ)); | 469 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
470 return handleScope.Close(templ); | 470 return handleScope.Close(templ); |
471 } | 471 } |
472 | 472 |
473 bool V8SupportTestInterface::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isol
ate* isolate, WrapperWorldType currentWorldType) | 473 bool V8SupportTestInterface::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isol
ate* isolate, WrapperWorldType currentWorldType) |
474 { | 474 { |
475 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, currentW
orldType); | 475 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
476 } | 476 } |
477 | 477 |
478 bool V8SupportTestInterface::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue
, v8::Isolate* isolate) | 478 bool V8SupportTestInterface::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue
, v8::Isolate* isolate) |
479 { | 479 { |
480 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, MainWorl
d) | 480 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
481 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, Isolated
World) | 481 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
482 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, WorkerWo
rld); | 482 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
483 } | 483 } |
484 | 484 |
485 void V8SupportTestInterface::installPerContextEnabledProperties(v8::Handle<v8::O
bject> instance, SupportTestInterface* impl, v8::Isolate* isolate) | 485 void V8SupportTestInterface::installPerContextEnabledProperties(v8::Handle<v8::O
bject> instance, SupportTestInterface* impl, v8::Isolate* isolate) |
486 { | 486 { |
487 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); | 487 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetProto
type()); |
488 if (ContextFeatures::featureName14Enabled(impl->document())) { | 488 if (ContextFeatures::featureName14Enabled(impl->document())) { |
489 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 489 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
490 {"Node14", SupportTestInterfaceV8Internal::Node14AttributeGetterCallback
, SupportTestInterfaceV8Internal::Node14AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}; | 490 {"Node14", SupportTestInterfaceV8Internal::Node14AttributeGetterCallback
, SupportTestInterfaceV8Internal::Node14AttributeSetterCallback, 0, 0, 0, static
_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No
ne), 0 /* on instance */}; |
491 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura
tion, isolate); | 491 V8DOMConfiguration::installAttribute(instance, proto, attributeConfigura
tion, isolate); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 v8::Handle<v8::Object> V8SupportTestInterface::createWrapper(PassRefPtr<SupportT
estInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate
) | 495 v8::Handle<v8::Object> V8SupportTestInterface::createWrapper(PassRefPtr<SupportT
estInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate
) |
496 { | 496 { |
497 ASSERT(impl); | 497 ASSERT(impl); |
498 ASSERT(!DOMDataStore::containsWrapper<V8SupportTestInterface>(impl.get(), is
olate)); | 498 ASSERT(!DOMDataStore::containsWrapper<V8SupportTestInterface>(impl.get(), is
olate)); |
499 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 499 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
500 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 500 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
501 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 501 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
502 // the same object de-ref functions, though, so use that as the basis of
the check. | 502 // the same object de-ref functions, though, so use that as the basis of
the check. |
503 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); | 503 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
504 } | 504 } |
505 | 505 |
506 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); | 506 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
507 if (UNLIKELY(wrapper.IsEmpty())) | 507 if (UNLIKELY(wrapper.IsEmpty())) |
508 return wrapper; | 508 return wrapper; |
509 | 509 |
510 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 510 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
511 V8DOMWrapper::associateObjectWithWrapper<V8SupportTestInterface>(impl, &info
, wrapper, isolate, WrapperConfiguration::Independent); | 511 V8DOMWrapper::associateObjectWithWrapper<V8SupportTestInterface>(impl, &wrap
perTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
512 return wrapper; | 512 return wrapper; |
513 } | 513 } |
514 | 514 |
515 void V8SupportTestInterface::derefObject(void* object) | 515 void V8SupportTestInterface::derefObject(void* object) |
516 { | 516 { |
517 fromInternalPointer(object)->deref(); | 517 fromInternalPointer(object)->deref(); |
518 } | 518 } |
519 | 519 |
520 } // namespace WebCore | 520 } // namespace WebCore |
OLD | NEW |