| OLD | NEW |
| 1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
| 2 | 2 |
| 3 | 3 |
| 4 {##############################################################################} | 4 {##############################################################################} |
| 5 {% macro attribute_configuration(attribute) %} | 5 {% macro attribute_configuration(attribute) %} |
| 6 {% set getter_callback_name = | 6 {% set getter_callback_name = |
| 7 '%sV8Internal::%sAttributeGetterCallback' % | 7 '%sV8Internal::%sAttributeGetterCallback' % |
| 8 (interface_name, attribute.name) | 8 (interface_name, attribute.name) |
| 9 if not attribute.constructor_type else | 9 if not attribute.constructor_type else |
| 10 '{0}V8Internal::{0}ConstructorGetter'.format(interface_name) %} | 10 '{0}V8Internal::{0}ConstructorGetter'.format(interface_name) %} |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 if (context && context->isDocument() && {{method.per_context_enabled_functio
n_name}}(toDocument(context))) | 330 if (context && context->isDocument() && {{method.per_context_enabled_functio
n_name}}(toDocument(context))) |
| 331 prototypeTemplate->Set(v8::String::NewSymbol("{{method.name}}"), v8::Fun
ctionTemplate::New({{cpp_class_name}}V8Internal::{{method.name}}MethodCallback,
v8Undefined(), defaultSignature, {{method.number_of_required_arguments}})->GetFu
nction()); | 331 prototypeTemplate->Set(v8::String::NewSymbol("{{method.name}}"), v8::Fun
ctionTemplate::New({{cpp_class_name}}V8Internal::{{method.name}}MethodCallback,
v8Undefined(), defaultSignature, {{method.number_of_required_arguments}})->GetFu
nction()); |
| 332 {% endfor %} | 332 {% endfor %} |
| 333 } | 333 } |
| 334 | 334 |
| 335 {% endif %} | 335 {% endif %} |
| 336 {% endblock %} | 336 {% endblock %} |
| 337 | 337 |
| 338 | 338 |
| 339 {##############################################################################} | 339 {##############################################################################} |
| 340 {% block to_active_dom_object %} |
| 341 {% if is_active_dom_object %} |
| 342 ActiveDOMObject* {{v8_class_name}}::toActiveDOMObject(v8::Handle<v8::Object> obj
ect) |
| 343 { |
| 344 return toNative(object); |
| 345 } |
| 346 |
| 347 {% endif %} |
| 348 {% endblock %} |
| 349 |
| 350 |
| 351 {##############################################################################} |
| 340 {% block create_wrapper_and_deref_object %} | 352 {% block create_wrapper_and_deref_object %} |
| 341 v8::Handle<v8::Object> {{v8_class_name}}::createWrapper(PassRefPtr<{{cpp_class_n
ame}}> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 353 v8::Handle<v8::Object> {{v8_class_name}}::createWrapper(PassRefPtr<{{cpp_class_n
ame}}> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 342 { | 354 { |
| 343 ASSERT(impl); | 355 ASSERT(impl); |
| 344 ASSERT(!DOMDataStore::containsWrapper<{{v8_class_name}}>(impl.get(), isolate
)); | 356 ASSERT(!DOMDataStore::containsWrapper<{{v8_class_name}}>(impl.get(), isolate
)); |
| 345 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 357 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 346 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 358 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 347 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 359 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 348 // the same object de-ref functions, though, so use that as the basis of
the check. | 360 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 349 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 361 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
| 350 } | 362 } |
| 351 | 363 |
| 352 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); | 364 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
| 353 if (UNLIKELY(wrapper.IsEmpty())) | 365 if (UNLIKELY(wrapper.IsEmpty())) |
| 354 return wrapper; | 366 return wrapper; |
| 355 | 367 |
| 356 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 368 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
| 357 V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &wrapperTy
peInfo, wrapper, isolate, WrapperConfiguration::Independent); | 369 {% set wrapper_configuration = 'WrapperConfiguration::Dependent' |
| 370 if is_active_dom_object else |
| 371 'WrapperConfiguration::Independent' %} |
| 372 V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &wrapperTy
peInfo, wrapper, isolate, {{wrapper_configuration}}); |
| 358 return wrapper; | 373 return wrapper; |
| 359 } | 374 } |
| 360 | 375 |
| 361 void {{v8_class_name}}::derefObject(void* object) | 376 void {{v8_class_name}}::derefObject(void* object) |
| 362 { | 377 { |
| 363 fromInternalPointer(object)->deref(); | 378 fromInternalPointer(object)->deref(); |
| 364 } | 379 } |
| 365 | 380 |
| 366 {% endblock %} | 381 {% endblock %} |
| OLD | NEW |