OLD | NEW |
1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
2 | 2 |
3 | 3 |
4 {##############################################################################} | 4 {##############################################################################} |
5 {% block indexed_property_getter %} | 5 {% block indexed_property_getter %} |
6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} | 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} |
7 {% set getter = indexed_property_getter %} | 7 {% set getter = indexed_property_getter %} |
8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
9 { | 9 { |
10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); | 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 420 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
421 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value,
info); | 421 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value,
info); |
422 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 422 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
423 } | 423 } |
424 | 424 |
425 {% endif %} | 425 {% endif %} |
426 {% endblock %} | 426 {% endblock %} |
427 | 427 |
428 | 428 |
429 {##############################################################################} | 429 {##############################################################################} |
| 430 {% block named_constructor %} |
430 {% from 'methods.cpp' import generate_constructor with context %} | 431 {% from 'methods.cpp' import generate_constructor with context %} |
431 {% block named_constructor %} | |
432 {% if named_constructor %} | 432 {% if named_constructor %} |
433 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class | 433 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class |
434 if is_active_dom_object else '0' %} | 434 if is_active_dom_object else '0' %} |
435 {% set to_event_target = '%s::toEventTarget' % v8_class | 435 {% set to_event_target = '%s::toEventTarget' % v8_class |
436 if is_event_target else '0' %} | 436 if is_event_target else '0' %} |
437 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde
rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_clas
s}}::derefObject, {{v8_class}}::createPersistentHandle, {{to_active_dom_object}}
, {{to_event_target}}, 0, {{v8_class}}::installConditionallyEnabledMethods, {{v8
_class}}::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperType
ObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifet
ime}}, WrapperTypeInfo::{{gc_type}} }; | 437 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde
rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_clas
s}}::derefObject, {{v8_class}}::createPersistentHandle, {{to_active_dom_object}}
, {{to_event_target}}, 0, {{v8_class}}::installConditionallyEnabledMethods, {{v8
_class}}::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperType
ObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifet
ime}}, WrapperTypeInfo::{{gc_type}} }; |
438 | 438 |
439 {{generate_constructor(named_constructor)}} | 439 {{generate_constructor(named_constructor)}} |
440 v8::Handle<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolat
e* isolate) | 440 v8::Handle<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolat
e* isolate) |
441 { | 441 { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } | 594 } |
595 {% endif %} | 595 {% endif %} |
596 setObjectGroup(internalPointer, wrapper, isolate); | 596 setObjectGroup(internalPointer, wrapper, isolate); |
597 } | 597 } |
598 | 598 |
599 {% endif %} | 599 {% endif %} |
600 {% endblock %} | 600 {% endblock %} |
601 | 601 |
602 | 602 |
603 {##############################################################################} | 603 {##############################################################################} |
| 604 {% block shadow_attributes %} |
604 {% from 'attributes.cpp' import attribute_configuration with context %} | 605 {% from 'attributes.cpp' import attribute_configuration with context %} |
605 {% block shadow_attributes %} | |
606 {% if interface_name == 'Window' %} | 606 {% if interface_name == 'Window' %} |
607 static const V8DOMConfiguration::AttributeConfiguration shadowAttributes[] = { | 607 static const V8DOMConfiguration::AttributeConfiguration shadowAttributes[] = { |
608 {% for attribute in attributes if attribute.is_unforgeable and attribute.sho
uld_be_exposed_to_script %} | 608 {% for attribute in attributes if attribute.is_unforgeable and attribute.sho
uld_be_exposed_to_script %} |
609 {{attribute_configuration(attribute)}}, | 609 {{attribute_configuration(attribute)}}, |
610 {% endfor %} | 610 {% endfor %} |
611 }; | 611 }; |
612 | 612 |
613 {% endif %} | 613 {% endif %} |
614 {% endblock %} | 614 {% endblock %} |
615 | 615 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba
ck_for_main_world}}, {{setter_callback_for_main_world}}, &{{v8_class}}::wrapperT
ypeInfo, v8::ALL_CAN_READ, {{property_attribute}}, {{only_exposed_to_private_scr
ipt}}, V8DOMConfiguration::OnInstance, | 722 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba
ck_for_main_world}}, {{setter_callback_for_main_world}}, &{{v8_class}}::wrapperT
ypeInfo, v8::ALL_CAN_READ, {{property_attribute}}, {{only_exposed_to_private_scr
ipt}}, V8DOMConfiguration::OnInstance, |
723 }; | 723 }; |
724 V8DOMConfiguration::installAttribute({{method.function_template}}, v8::Handle<v8
::ObjectTemplate>(), {{method.name}}OriginSafeAttributeConfiguration, isolate); | 724 V8DOMConfiguration::installAttribute({{method.function_template}}, v8::Handle<v8
::ObjectTemplate>(), {{method.name}}OriginSafeAttributeConfiguration, isolate); |
725 {%- endmacro %} | 725 {%- endmacro %} |
726 | 726 |
727 | 727 |
728 {##############################################################################} | 728 {##############################################################################} |
729 {% block get_dom_template %} | 729 {% block get_dom_template %} |
730 v8::Handle<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate) | 730 v8::Handle<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate) |
731 { | 731 { |
732 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), install{{v8_class}}Template); | 732 {% if has_partial_interface %} |
| 733 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class
, v8_class) %} |
| 734 ASSERT({{installTemplateFunction}} != {{actual_v8_class}}::install{{v8_class
}}Template); |
| 735 {% else %} |
| 736 {% set installTemplateFunction = 'install%sTemplate' % v8_class %} |
| 737 {% endif %} |
| 738 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class, v8
_class) if has_partial_interface else 'install%sTemplate' % v8_class %} |
| 739 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), {{installTemplateFunction}}); |
733 } | 740 } |
734 | 741 |
735 {% endblock %} | 742 {% endblock %} |
736 | 743 |
737 | 744 |
738 {##############################################################################} | 745 {##############################################################################} |
739 {% block has_instance %} | 746 {% block has_instance %} |
740 bool {{v8_class}}::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isola
te) | 747 bool {{v8_class}}::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isola
te) |
741 { | 748 { |
742 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 749 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 {% endif %} | 902 {% endif %} |
896 } | 903 } |
897 | 904 |
898 template<> | 905 template<> |
899 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 906 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
900 { | 907 { |
901 return toV8(impl, creationContext, isolate); | 908 return toV8(impl, creationContext, isolate); |
902 } | 909 } |
903 | 910 |
904 {% endblock %} | 911 {% endblock %} |
| 912 |
| 913 {##############################################################################} |
| 914 {% block partial_interface %} |
| 915 {% if has_partial_interface %} |
| 916 InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = (Ins
tallTemplateFunction)&{{v8_class}}::install{{v8_class}}Template; |
| 917 |
| 918 void {{v8_class}}::updateWrapperTypeInfo(InstallTemplateFunction installTemplate
Function, InstallConditionallyEnabledMethodsFunction installConditionallyEnabled
MethodsFunction) |
| 919 { |
| 920 {{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction; |
| 921 if (installConditionallyEnabledMethodsFunction) |
| 922 {{v8_class}}::wrapperTypeInfo.installConditionallyEnabledMethodsFunction
= installConditionallyEnabledMethodsFunction; |
| 923 } |
| 924 |
| 925 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
| 926 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 927 { |
| 928 {{actual_cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = m
ethod; |
| 929 } |
| 930 {% endfor %} |
| 931 {% endif %} |
| 932 {% endblock %} |
OLD | NEW |