Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: Source/bindings/templates/interface.cpp

Issue 296403007: Set correct Function.length on overloaded methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed nits Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 {%- endmacro %} 50 {%- endmacro %}
51 51
52 52
53 {##############################################################################} 53 {##############################################################################}
54 {% macro method_configuration(method) %} 54 {% macro method_configuration(method) %}
55 {% set method_callback = 55 {% set method_callback =
56 '%sV8Internal::%sMethodCallback' % (cpp_class, method.name) %} 56 '%sV8Internal::%sMethodCallback' % (cpp_class, method.name) %}
57 {% set method_callback_for_main_world = 57 {% set method_callback_for_main_world =
58 '%sV8Internal::%sMethodCallbackForMainWorld' % (cpp_class, method.name) 58 '%sV8Internal::%sMethodCallbackForMainWorld' % (cpp_class, method.name)
59 if method.is_per_world_bindings else '0' %} 59 if method.is_per_world_bindings else '0' %}
60 {"{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{m ethod.number_of_required_or_variadic_arguments}}} 60 {"{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{m ethod.length}}}
61 {%- endmacro %} 61 {%- endmacro %}
62 62
63 63
64 {##############################################################################} 64 {##############################################################################}
65 {% block constructor_getter %} 65 {% block constructor_getter %}
66 {% if has_constructor_attributes %} 66 {% if has_constructor_attributes %}
67 static void {{cpp_class}}ConstructorGetter(v8::Local<v8::String>, const v8::Prop ertyCallbackInfo<v8::Value>& info) 67 static void {{cpp_class}}ConstructorGetter(v8::Local<v8::String>, const v8::Prop ertyCallbackInfo<v8::Value>& info)
68 { 68 {
69 v8::Handle<v8::Value> data = info.Data(); 69 v8::Handle<v8::Value> data = info.Data();
70 ASSERT(data->IsExternal()); 70 ASSERT(data->IsExternal());
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 {%- endmacro %} 1071 {%- endmacro %}
1072 1072
1073 1073
1074 {######################################} 1074 {######################################}
1075 {% macro install_custom_signature(method, world_suffix) %} 1075 {% macro install_custom_signature(method, world_suffix) %}
1076 {# FIXME: move to V8DOMConfiguration::installDOMCallbacksWithCustomSignature #} 1076 {# FIXME: move to V8DOMConfiguration::installDOMCallbacksWithCustomSignature #}
1077 {% set method_callback = '%sV8Internal::%sMethodCallback%s' % 1077 {% set method_callback = '%sV8Internal::%sMethodCallback%s' %
1078 (cpp_class, method.name, world_suffix) %} 1078 (cpp_class, method.name, world_suffix) %}
1079 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % 1079 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' %
1080 ' | '.join(method.property_attributes) %} 1080 ' | '.join(method.property_attributes) %}
1081 {{method.function_template}}->Set(v8AtomicString(isolate, "{{method.name}}"), v8 ::FunctionTemplate::New(isolate, {{method_callback}}, v8Undefined(), {{method.si gnature}}, {{method.number_of_required_or_variadic_arguments}}){% if method.prop erty_attributes %}, {{property_attribute}}{% endif %}); 1081 {{method.function_template}}->Set(v8AtomicString(isolate, "{{method.name}}"), v8 ::FunctionTemplate::New(isolate, {{method_callback}}, v8Undefined(), {{method.si gnature}}, {{method.length}}){% if method.property_attributes %}, {{property_att ribute}}{% endif %});
1082 {%- endmacro %} 1082 {%- endmacro %}
1083 1083
1084 1084
1085 {######################################} 1085 {######################################}
1086 {% macro install_constants() %} 1086 {% macro install_constants() %}
1087 {# FIXME: should use reflected_name instead of name #} 1087 {# FIXME: should use reflected_name instead of name #}
1088 {# Normal (always enabled) constants #} 1088 {# Normal (always enabled) constants #}
1089 static const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = { 1089 static const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = {
1090 {% for constant in constants if not constant.runtime_enabled_function %} 1090 {% for constant in constants if not constant.runtime_enabled_function %}
1091 {"{{constant.name}}", {{constant.value}}}, 1091 {"{{constant.name}}", {{constant.value}}},
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 {% endif %} 1335 {% endif %}
1336 } 1336 }
1337 1337
1338 template<> 1338 template<>
1339 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 1339 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
1340 { 1340 {
1341 return toV8(impl, creationContext, isolate); 1341 return toV8(impl, creationContext, isolate);
1342 } 1342 }
1343 1343
1344 {% endblock %} 1344 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698