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 (cpp_class, attribute.name) | 8 (cpp_class, attribute.name) |
9 if not attribute.constructor_type else | 9 if not attribute.constructor_type else |
10 ('%sV8Internal::%sConstructorGetterCallback' % | 10 ('%sV8Internal::%sConstructorGetterCallback' % |
(...skipping 12 matching lines...) Expand all Loading... |
23 (not attribute.is_read_only or attribute.put_forwards) else '0' %} | 23 (not attribute.is_read_only or attribute.put_forwards) else '0' %} |
24 {% set wrapper_type_info = | 24 {% set wrapper_type_info = |
25 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % | 25 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % |
26 attribute.constructor_type | 26 attribute.constructor_type |
27 if attribute.constructor_type else '0' %} | 27 if attribute.constructor_type else '0' %} |
28 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % | 28 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % |
29 ' | '.join(attribute.access_control_list) %} | 29 ' | '.join(attribute.access_control_list) %} |
30 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % | 30 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % |
31 ' | '.join(attribute.property_attributes) %} | 31 ' | '.join(attribute.property_attributes) %} |
32 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat
eScript' if attribute.only_exposed_to_private_script else 'V8DOMConfiguration::E
xposedToAllScripts' %} | 32 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat
eScript' if attribute.only_exposed_to_private_script else 'V8DOMConfiguration::E
xposedToAllScripts' %} |
33 {% set on_prototype = '1 /* on prototype */' | 33 {% set on_prototype = 'V8DOMConfiguration::OnPrototype' |
34 if interface_name == 'Window' and attribute.idl_type == 'EventHandler' | 34 if interface_name == 'Window' and attribute.idl_type == 'EventHandler' |
35 else '0 /* on instance */' %} | 35 else 'V8DOMConfiguration::OnInstance' %} |
36 {% set attribute_configuration_list = [ | 36 {% set attribute_configuration_list = [ |
37 '"%s"' % attribute.name, | 37 '"%s"' % attribute.name, |
38 getter_callback, | 38 getter_callback, |
39 setter_callback, | 39 setter_callback, |
40 getter_callback_for_main_world, | 40 getter_callback_for_main_world, |
41 setter_callback_for_main_world, | 41 setter_callback_for_main_world, |
42 wrapper_type_info, | 42 wrapper_type_info, |
43 access_control, | 43 access_control, |
44 property_attribute, | 44 property_attribute, |
45 only_exposed_to_private_script, | 45 only_exposed_to_private_script, |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 if not method.is_read_only else '0' %} | 1046 if not method.is_read_only else '0' %} |
1047 {% else %} | 1047 {% else %} |
1048 {% set getter_callback_for_main_world = '0' %} | 1048 {% set getter_callback_for_main_world = '0' %} |
1049 {% set setter_callback_for_main_world = '0' %} | 1049 {% set setter_callback_for_main_world = '0' %} |
1050 {% endif %} | 1050 {% endif %} |
1051 {% set property_attribute = | 1051 {% set property_attribute = |
1052 'static_cast<v8::PropertyAttribute>(%s)' % | 1052 'static_cast<v8::PropertyAttribute>(%s)' % |
1053 ' | '.join(method.property_attributes or ['v8::DontDelete']) %} | 1053 ' | '.join(method.property_attributes or ['v8::DontDelete']) %} |
1054 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat
eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo
sedToAllScripts' %} | 1054 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat
eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo
sedToAllScripts' %} |
1055 static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSaf
eAttributeConfiguration = { | 1055 static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSaf
eAttributeConfiguration = { |
1056 "{{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}}, false, | 1056 "{{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, |
1057 }; | 1057 }; |
1058 V8DOMConfiguration::installAttribute({{method.function_template}}, v8::Handle<v8
::ObjectTemplate>(), {{method.name}}OriginSafeAttributeConfiguration, isolate); | 1058 V8DOMConfiguration::installAttribute({{method.function_template}}, v8::Handle<v8
::ObjectTemplate>(), {{method.name}}OriginSafeAttributeConfiguration, isolate); |
1059 {%- endmacro %} | 1059 {%- endmacro %} |
1060 | 1060 |
1061 | 1061 |
1062 {######################################} | 1062 {######################################} |
1063 {% macro install_custom_signature(method) %} | 1063 {% macro install_custom_signature(method) %} |
1064 {% set method_callback = '%sV8Internal::%sMethodCallback' % (cpp_class, method.n
ame) %} | 1064 {% set method_callback = '%sV8Internal::%sMethodCallback' % (cpp_class, method.n
ame) %} |
1065 {% set method_callback_for_main_world = '%sForMainWorld' % method_callback | 1065 {% set method_callback_for_main_world = '%sForMainWorld' % method_callback |
1066 if method.is_per_world_bindings else '0' %} | 1066 if method.is_per_world_bindings else '0' %} |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 {% endif %} | 1343 {% endif %} |
1344 } | 1344 } |
1345 | 1345 |
1346 template<> | 1346 template<> |
1347 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 1347 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
1348 { | 1348 { |
1349 return toV8(impl, creationContext, isolate); | 1349 return toV8(impl, creationContext, isolate); |
1350 } | 1350 } |
1351 | 1351 |
1352 {% endblock %} | 1352 {% endblock %} |
OLD | NEW |