| 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 = | 6 {% set getter_callback = |
| 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 {% endblock %} | 331 {% endblock %} |
| 332 | 332 |
| 333 | 333 |
| 334 {##############################################################################} | 334 {##############################################################################} |
| 335 {% block configure_class_template %} | 335 {% block configure_class_template %} |
| 336 {# FIXME: rename to install_dom_template and Install{{v8_class}}DOMTemplate #} | 336 {# FIXME: rename to install_dom_template and Install{{v8_class}}DOMTemplate #} |
| 337 static v8::Handle<v8::FunctionTemplate> Configure{{v8_class}}Template(v8::Handle
<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType
currentWorldType) | 337 static v8::Handle<v8::FunctionTemplate> Configure{{v8_class}}Template(v8::Handle
<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType
currentWorldType) |
| 338 { | 338 { |
| 339 functionTemplate->ReadOnlyPrototype(); | 339 functionTemplate->ReadOnlyPrototype(); |
| 340 | 340 |
| 341 v8::Local<v8::Signature> defaultSignature; | 341 v8::Local<v8::Signature> ALLOW_UNUSED defaultSignature; |
| 342 {% set parent_template = | 342 {% set parent_template = |
| 343 'V8%s::domTemplate(isolate, currentWorldType)' % parent_interface | 343 'V8%s::domTemplate(isolate, currentWorldType)' % parent_interface |
| 344 if parent_interface else 'v8::Local<v8::FunctionTemplate>()' %} | 344 if parent_interface else 'v8::Local<v8::FunctionTemplate>()' %} |
| 345 {% if runtime_enabled_function %} | 345 {% if runtime_enabled_function %} |
| 346 if (!{{runtime_enabled_function}}()) | 346 if (!{{runtime_enabled_function}}()) |
| 347 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "", {{parent_template}}, {{v8_class}}::internalFieldCount, 0, 0, 0, 0,
0, 0, isolate, currentWorldType); | 347 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "", {{parent_template}}, {{v8_class}}::internalFieldCount, 0, 0, 0, 0,
0, 0, isolate, currentWorldType); |
| 348 else | 348 else |
| 349 {% endif %} | 349 {% endif %} |
| 350 {% set runtime_enabled_indent = 4 if runtime_enabled_function else 0 %} | 350 {% set runtime_enabled_indent = 4 if runtime_enabled_function else 0 %} |
| 351 {% filter indent(runtime_enabled_indent, true) %} | 351 {% filter indent(runtime_enabled_indent, true) %} |
| (...skipping 10 matching lines...) Expand all Loading... |
| 362 {% set methods_name, methods_length = | 362 {% set methods_name, methods_length = |
| 363 ('%sMethods' % v8_class, | 363 ('%sMethods' % v8_class, |
| 364 'WTF_ARRAY_LENGTH(%sMethods)' % v8_class) | 364 'WTF_ARRAY_LENGTH(%sMethods)' % v8_class) |
| 365 if has_method_configuration else (0, 0) %} | 365 if has_method_configuration else (0, 0) %} |
| 366 {{attributes_name}}, {{attributes_length}}, | 366 {{attributes_name}}, {{attributes_length}}, |
| 367 {{accessors_name}}, {{accessors_length}}, | 367 {{accessors_name}}, {{accessors_length}}, |
| 368 {{methods_name}}, {{methods_length}}, | 368 {{methods_name}}, {{methods_length}}, |
| 369 isolate, currentWorldType); | 369 isolate, currentWorldType); |
| 370 {% endfilter %} | 370 {% endfilter %} |
| 371 | 371 |
| 372 UNUSED_PARAM(defaultSignature); | |
| 373 {% if has_constructor or has_event_constructor %} | 372 {% if has_constructor or has_event_constructor %} |
| 374 functionTemplate->SetCallHandler({{v8_class}}::constructorCallback); | 373 functionTemplate->SetCallHandler({{v8_class}}::constructorCallback); |
| 375 functionTemplate->SetLength({{length}}); | 374 functionTemplate->SetLength({{length}}); |
| 376 {% endif %} | 375 {% endif %} |
| 377 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 376 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 378 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 377 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 379 UNUSED_PARAM(instanceTemplate); | |
| 380 UNUSED_PARAM(prototypeTemplate); | |
| 381 {% if is_check_security and interface_name != 'Window' %} | 378 {% if is_check_security and interface_name != 'Window' %} |
| 382 instanceTemplate->SetAccessCheckCallbacks({{cpp_class}}V8Internal::namedSecu
rityCheck, {{cpp_class}}V8Internal::indexedSecurityCheck, v8::External::New(isol
ate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperTypeInfo))); | 379 instanceTemplate->SetAccessCheckCallbacks({{cpp_class}}V8Internal::namedSecu
rityCheck, {{cpp_class}}V8Internal::indexedSecurityCheck, v8::External::New(isol
ate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperTypeInfo))); |
| 383 {% endif %} | 380 {% endif %} |
| 384 {% for attribute in attributes if attribute.runtime_enabled_function %} | 381 {% for attribute in attributes if attribute.runtime_enabled_function %} |
| 385 {% filter conditional(attribute.conditional_string) %} | 382 {% filter conditional(attribute.conditional_string) %} |
| 386 if ({{attribute.runtime_enabled_function}}()) { | 383 if ({{attribute.runtime_enabled_function}}()) { |
| 387 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 384 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
| 388 {{attribute_configuration(attribute)}}; | 385 {{attribute_configuration(attribute)}}; |
| 389 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); | 386 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); |
| 390 } | 387 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 567 |
| 571 {% endif %} | 568 {% endif %} |
| 572 {% endblock %} | 569 {% endblock %} |
| 573 | 570 |
| 574 | 571 |
| 575 {##############################################################################} | 572 {##############################################################################} |
| 576 {% block install_per_context_methods %} | 573 {% block install_per_context_methods %} |
| 577 {% if has_per_context_enabled_methods %} | 574 {% if has_per_context_enabled_methods %} |
| 578 void {{v8_class}}::installPerContextEnabledMethods(v8::Handle<v8::Object> protot
ypeTemplate, v8::Isolate* isolate) | 575 void {{v8_class}}::installPerContextEnabledMethods(v8::Handle<v8::Object> protot
ypeTemplate, v8::Isolate* isolate) |
| 579 { | 576 { |
| 580 UNUSED_PARAM(prototypeTemplate); | |
| 581 {# Define per-context enabled operations #} | 577 {# Define per-context enabled operations #} |
| 582 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate, worldType(isolate))); | 578 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate, worldType(isolate))); |
| 583 UNUSED_PARAM(defaultSignature); | |
| 584 | 579 |
| 585 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); | 580 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); |
| 586 {% for method in methods if method.per_context_enabled_function %} | 581 {% for method in methods if method.per_context_enabled_function %} |
| 587 if (context && context->isDocument() && {{method.per_context_enabled_functio
n}}(toDocument(context))) | 582 if (context && context->isDocument() && {{method.per_context_enabled_functio
n}}(toDocument(context))) |
| 588 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "{{method.name}}
", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, {{cpp_cl
ass}}V8Internal::{{method.name}}MethodCallback, v8Undefined(), defaultSignature,
{{method.number_of_required_arguments}})->GetFunction()); | 583 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "{{method.name}}
", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, {{cpp_cl
ass}}V8Internal::{{method.name}}MethodCallback, v8Undefined(), defaultSignature,
{{method.number_of_required_arguments}})->GetFunction()); |
| 589 {% endfor %} | 584 {% endfor %} |
| 590 } | 585 } |
| 591 | 586 |
| 592 {% endif %} | 587 {% endif %} |
| 593 {% endblock %} | 588 {% endblock %} |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 fromInternalPointer(object)->deref(); | 657 fromInternalPointer(object)->deref(); |
| 663 } | 658 } |
| 664 | 659 |
| 665 template<> | 660 template<> |
| 666 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 661 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
| 667 { | 662 { |
| 668 return toV8(impl, creationContext, isolate); | 663 return toV8(impl, creationContext, isolate); |
| 669 } | 664 } |
| 670 | 665 |
| 671 {% endblock %} | 666 {% endblock %} |
| OLD | NEW |