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

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

Issue 2043503002: Add [CEReactions] IDL attributes for Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 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
OLDNEW
1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value %} 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% macro generate_method(method, world_suffix) %} 4 {% macro generate_method(method, world_suffix) %}
5 {% if method.returns_promise and method.has_exception_state %} 5 {% if method.returns_promise and method.has_exception_state %}
6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
7 {% else %} 7 {% else %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
9 {% endif %} 9 {% endif %}
10 { 10 {
11 {# Local variables #} 11 {# Local variables #}
12 {% if method.has_exception_state and not method.returns_promise %} 12 {% if method.has_exception_state and not method.returns_promise %}
13 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 13 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
14 {% endif %} 14 {% endif %}
15 {# Overloaded methods have length checked during overload resolution #} 15 {# Overloaded methods have length checked during overload resolution #}
16 {% if method.number_of_required_arguments and not method.overload_index %} 16 {% if method.number_of_required_arguments and not method.overload_index %}
17 if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { 17 if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) {
18 {{throw_minimum_arity_type_error(method, method.number_of_required_argum ents) | indent(8)}} 18 {{throw_minimum_arity_type_error(method, method.number_of_required_argum ents) | indent(8)}}
19 } 19 }
20 {% endif %} 20 {% endif %}
21 {% if not method.is_static %} 21 {% if not method.is_static %}
22 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); 22 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
23 {% endif %} 23 {% endif %}
24 {% if method.is_ce_reactions %}
25 CEReactionsScope reactions;
Yuki 2016/06/06 06:13:56 Ditto.
kojii 2016/06/07 07:51:17 Done too.
26 {% endif %}
24 {% if method.is_custom_element_callbacks %} 27 {% if method.is_custom_element_callbacks %}
25 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 28 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
26 {% endif %} 29 {% endif %}
27 {# Security checks #} 30 {# Security checks #}
28 {% if method.is_check_security_for_receiver %} 31 {% if method.is_check_security_for_receiver %}
29 {% if interface_name == 'EventTarget' %} 32 {% if interface_name == 'EventTarget' %}
30 // Performance hack for EventTarget. Checking whether it's a Window or not 33 // Performance hack for EventTarget. Checking whether it's a Window or not
31 // prior to the call to BindingSecurity::shouldAllowAccessTo increases 30% 34 // prior to the call to BindingSecurity::shouldAllowAccessTo increases 30%
32 // of speed performance on Android Nexus 7 as of Dec 2015. ALWAYS_INLINE 35 // of speed performance on Android Nexus 7 as of Dec 2015. ALWAYS_INLINE
33 // didn't work in this case. 36 // didn't work in this case.
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 683 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
681 if method.overloads else 684 if method.overloads else
682 method.runtime_enabled_function) %} 685 method.runtime_enabled_function) %}
683 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; 686 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}};
684 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); 687 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration);
685 {% endfilter %}{# runtime_enabled() #} 688 {% endfilter %}{# runtime_enabled() #}
686 {% endfilter %}{# exposed() #} 689 {% endfilter %}{# exposed() #}
687 {% endfor %} 690 {% endfor %}
688 {% endif %} 691 {% endif %}
689 {%- endmacro %} 692 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698