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

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

Issue 668673002: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: Created 6 years, 2 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
OLDNEW
1 {##############################################################################} 1 {##############################################################################}
2 {% macro generate_method(method, world_suffix) %} 2 {% macro generate_method(method, world_suffix) %}
3 {% filter conditional(method.conditional_string) %} 3 {% filter conditional(method.conditional_string) %}
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
5 { 5 {
6 {# Local variables #} 6 {# Local variables #}
7 {% if method.has_exception_state %} 7 {% if method.has_exception_state %}
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
9 {% endif %} 9 {% endif %}
10 {# Overloaded methods have length checked during overload resolution #} 10 {# Overloaded methods have length checked during overload resolution #}
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 {%- endif %}{# None for void #} 265 {%- endif %}{# None for void #}
266 {# Post-set #} 266 {# Post-set #}
267 {% if interface_name in ('EventTarget', 'MediaQueryList') 267 {% if interface_name in ('EventTarget', 'MediaQueryList')
268 and method.name in ('addEventListener', 'removeEventListener', 'addListener' , 'removeListener') %} 268 and method.name in ('addEventListener', 'removeEventListener', 'addListener' , 'removeListener') %}
269 {% set hidden_dependency_action = 'addHiddenValueToArray' 269 {% set hidden_dependency_action = 'addHiddenValueToArray'
270 if method.name in ('addEventListener', 'addListener') else 'removeHiddenV alueFromArray' %} 270 if method.name in ('addEventListener', 'addListener') else 'removeHiddenV alueFromArray' %}
271 {% set argument_index = '1' if interface_name == 'EventTarget' else '0' %} 271 {% set argument_index = '1' if interface_name == 'EventTarget' else '0' %}
272 {# Length check needed to skip action on legacy calls without enough arguments. 272 {# Length check needed to skip action on legacy calls without enough arguments.
273 http://crbug.com/353484 #} 273 http://crbug.com/353484 #}
274 if (info.Length() >= {{argument_index}} + 1 && listener && !impl->toNode()) 274 if (info.Length() >= {{argument_index}} + 1 && listener && !impl->toNode())
275 {{hidden_dependency_action}}(info.Holder(), info[{{argument_index}}], {{v8_c lass}}::eventListenerCacheIndex, info.GetIsolate()); 275 {{hidden_dependency_action}}(info.GetIsolate(), info.Holder(), info[{{argume nt_index}}], {{v8_class}}::eventListenerCacheIndex);
276 {% endif %} 276 {% endif %}
277 {% endmacro %} 277 {% endmacro %}
278 278
279 279
280 {######################################} 280 {######################################}
281 {% macro union_type_method_call_and_set_return_value(method) %} 281 {% macro union_type_method_call_and_set_return_value(method) %}
282 {% for argument in method.union_arguments %} 282 {% for argument in method.union_arguments %}
283 {{argument.cpp_type}} {{argument.cpp_value}}{{argument.cpp_type_initializer}}; 283 {{argument.cpp_type}} {{argument.cpp_value}}{{argument.cpp_type_initializer}};
284 {% endfor %} 284 {% endfor %}
285 {{method.cpp_value}}; 285 {{method.cpp_value}};
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 if method.is_per_world_bindings else '0' %} 619 if method.is_per_world_bindings else '0' %}
620 {% set property_attribute = 620 {% set property_attribute =
621 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es) 621 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es)
622 if method.property_attributes else 'v8::None' %} 622 if method.property_attributes else 'v8::None' %}
623 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %} 623 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %}
624 static const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfig uration = { 624 static const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfig uration = {
625 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.length}}, {{only_exposed_to_private_script}}, 625 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.length}}, {{only_exposed_to_private_script}},
626 }; 626 };
627 V8DOMConfiguration::installMethod({{method.function_template}}, {{method.signatu re}}, {{property_attribute}}, {{method.name}}MethodConfiguration, isolate); 627 V8DOMConfiguration::installMethod({{method.function_template}}, {{method.signatu re}}, {{property_attribute}}, {{method.name}}MethodConfiguration, isolate);
628 {%- endmacro %} 628 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698