| OLD | NEW | 
|    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     {% if method.name in ['addEventListener', 'removeEventListener'] %} |    6     {% if method.name in ['addEventListener', 'removeEventListener'] %} | 
|    7     {{add_remove_event_listener_method(method.name) | indent}} |    7     {{add_remove_event_listener_method(method.name) | indent}} | 
|    8     {% else %} |    8     {% else %} | 
|    9     {% if method.number_of_required_arguments %} |    9     {% if method.number_of_required_arguments %} | 
|   10     if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { |   10     if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { | 
|   11         throwTypeError(ExceptionMessages::failedToExecute("{{method.name}}", "{{
     interface_name}}", ExceptionMessages::notEnoughArguments({{method.number_of_requ
     ired_arguments}}, info.Length())), info.GetIsolate()); |   11         throwTypeError(ExceptionMessages::failedToExecute("{{method.name}}", "{{
     interface_name}}", ExceptionMessages::notEnoughArguments({{method.number_of_requ
     ired_arguments}}, info.Length())), info.GetIsolate()); | 
|   12         return; |   12         return; | 
|   13     } |   13     } | 
|   14     {% endif %} |   14     {% endif %} | 
|   15     {% if not method.is_static %} |   15     {% if not method.is_static %} | 
|   16     {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); |   16     {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); | 
|   17     {% endif %} |   17     {% endif %} | 
|   18     {% if method.is_custom_element_callbacks %} |   18     {% if method.is_custom_element_callbacks %} | 
|   19     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |   19     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 
|   20     {% endif %} |   20     {% endif %} | 
|   21     {% if method.is_raises_exception %} |   21     {% if method.is_raises_exception or method.is_check_security_for_frame %} | 
|   22     ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |   22     ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 
|   23     {% endif %} |   23     {% endif %} | 
 |   24     {% if method.is_check_security_for_frame %} | 
 |   25     if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)
     ) { | 
 |   26         exceptionState.throwIfNeeded(); | 
 |   27         return; | 
 |   28     } | 
 |   29     {% endif %} | 
|   24     {% if method.is_check_security_for_node %} |   30     {% if method.is_check_security_for_node %} | 
|   25     if (!BindingSecurity::shouldAllowAccessToNode(imp->{{method.name}}(exception
     State), exceptionState)) { |   31     if (!BindingSecurity::shouldAllowAccessToNode(imp->{{method.name}}(exception
     State), exceptionState)) { | 
|   26         v8SetReturnValueNull(info); |   32         v8SetReturnValueNull(info); | 
|   27         exceptionState.throwIfNeeded(); |   33         exceptionState.throwIfNeeded(); | 
|   28         return; |   34         return; | 
|   29     } |   35     } | 
|   30     {% endif %} |   36     {% endif %} | 
|   31     {% for argument in method.arguments %} |   37     {% for argument in method.arguments %} | 
|   32     {% if argument.is_optional and not argument.has_default and |   38     {% if argument.is_optional and not argument.has_default and | 
|   33           argument.idl_type != 'Dictionary' %} |   39           argument.idl_type != 'Dictionary' %} | 
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  202     {% endif %} |  208     {% endif %} | 
|  203     {% if method.is_custom %} |  209     {% if method.is_custom %} | 
|  204     {{v8_class_name}}::{{method.name}}MethodCustom(info); |  210     {{v8_class_name}}::{{method.name}}MethodCustom(info); | 
|  205     {% else %} |  211     {% else %} | 
|  206     {{cpp_class_name}}V8Internal::{{method.name}}Method{{world_suffix}}(info); |  212     {{cpp_class_name}}V8Internal::{{method.name}}Method{{world_suffix}}(info); | 
|  207     {% endif %} |  213     {% endif %} | 
|  208     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |  214     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 
|  209 } |  215 } | 
|  210 {% endfilter %} |  216 {% endfilter %} | 
|  211 {% endmacro %} |  217 {% endmacro %} | 
| OLD | NEW |