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

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

Issue 1233483002: Add counters for add/removeEventListener() called with one argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No [Conditional] support Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/templates/interface.h ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %} 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l ocal_cpp_value %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro generate_method(method, world_suffix) %} 5 {% macro generate_method(method, world_suffix) %}
6 {% filter conditional(method.conditional_string) %} 6 {% filter conditional(method.conditional_string) %}
7 {% if method.returns_promise and method.has_exception_state %} 7 {% if method.returns_promise and method.has_exception_state %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
9 {% else %} 9 {% else %}
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (!{{argument.name}}.isUndefinedOrNull() && !{{argument.name}}.isObject()) { 209 if (!{{argument.name}}.isUndefinedOrNull() && !{{argument.name}}.isObject()) {
210 {{throw_type_error(method, '"parameter %s (\'%s\') is not an object."' % 210 {{throw_type_error(method, '"parameter %s (\'%s\') is not an object."' %
211 (argument.index + 1, argument.name)) | indent}} 211 (argument.index + 1, argument.name)) | indent}}
212 } 212 }
213 {% endif %} 213 {% endif %}
214 {% endmacro %} 214 {% endmacro %}
215 215
216 216
217 {######################################} 217 {######################################}
218 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %} 218 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %}
219 {% if method.is_custom_call_prologue %}
220 {{v8_class}}::{{method.name}}MethodPrologueCustom(info, impl);
221 {% endif %}
219 {# Local variables #} 222 {# Local variables #}
220 {% if method.is_call_with_script_state or method.is_call_with_this_value %} 223 {% if method.is_call_with_script_state or method.is_call_with_this_value %}
221 {# [ConstructorCallWith=ScriptState] #} 224 {# [ConstructorCallWith=ScriptState] #}
222 {# [CallWith=ScriptState] #} 225 {# [CallWith=ScriptState] #}
223 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 226 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
224 {% endif %} 227 {% endif %}
225 {% if method.is_call_with_execution_context %} 228 {% if method.is_call_with_execution_context %}
226 {# [ConstructorCallWith=ExecutionContext] #} 229 {# [ConstructorCallWith=ExecutionContext] #}
227 {# [CallWith=ExecutionContext] #} 230 {# [CallWith=ExecutionContext] #}
228 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 231 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 if method.overloads else 693 if method.overloads else
691 method.runtime_enabled_function) %} 694 method.runtime_enabled_function) %}
692 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(iso late, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCallback, v8Undef ined(), defaultSignature, {{method.number_of_required_arguments}}); 695 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(iso late, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCallback, v8Undef ined(), defaultSignature, {{method.number_of_required_arguments}});
693 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())). ToLocalChecked(); 696 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())). ToLocalChecked();
694 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString( isolate, "{{method.name}}"), function)); 697 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString( isolate, "{{method.name}}"), function));
695 {% endfilter %}{# runtime_enabled() #} 698 {% endfilter %}{# runtime_enabled() #}
696 {% endfilter %}{# exposed() #} 699 {% endfilter %}{# exposed() #}
697 {% endfor %} 700 {% endfor %}
698 {% endif %} 701 {% endif %}
699 {%- endmacro %} 702 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface.h ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698