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

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

Issue 690243002: 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, 1 month 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), {{create_mini mum_arity_type_error_without_exception_state(method, number_of_required_argument s)}})); 317 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), {{create_mini mum_arity_type_error_without_exception_state(method, number_of_required_argument s)}}));
318 {%- else %} 318 {%- else %}
319 V8ThrowException::throwException({{create_minimum_arity_type_error_without_excep tion_state(method, number_of_required_arguments)}}, info.GetIsolate()); 319 V8ThrowException::throwException({{create_minimum_arity_type_error_without_excep tion_state(method, number_of_required_arguments)}}, info.GetIsolate());
320 {%- endif %} 320 {%- endif %}
321 {%- endmacro %} 321 {%- endmacro %}
322 322
323 323
324 {######################################} 324 {######################################}
325 {% macro create_minimum_arity_type_error_without_exception_state(method, number_ of_required_arguments) %} 325 {% macro create_minimum_arity_type_error_without_exception_state(method, number_ of_required_arguments) %}
326 {% if method.is_constructor %} 326 {% if method.is_constructor %}
327 createMinimumArityTypeErrorForConstructor("{{interface_name}}", {{number_of_requ ired_arguments}}, info.Length(), info.GetIsolate()) 327 createMinimumArityTypeErrorForConstructor(info.GetIsolate(), "{{interface_name}} ", {{number_of_required_arguments}}, info.Length())
328 {%- else %} 328 {%- else %}
329 createMinimumArityTypeErrorForMethod("{{method.name}}", "{{interface_name}}", {{ number_of_required_arguments}}, info.Length(), info.GetIsolate()) 329 createMinimumArityTypeErrorForMethod(info.GetIsolate(), "{{method.name}}", "{{in terface_name}}", {{number_of_required_arguments}}, info.Length())
330 {%- endif %} 330 {%- endif %}
331 {%- endmacro %} 331 {%- endmacro %}
332 332
333 333
334 {##############################################################################} 334 {##############################################################################}
335 {# FIXME: We should return a rejected Promise if an error occurs in this 335 {# FIXME: We should return a rejected Promise if an error occurs in this
336 function when ALL methods in this overload return Promise. In order to do so, 336 function when ALL methods in this overload return Promise. In order to do so,
337 we must ensure either ALL or NO methods in this overload return Promise #} 337 we must ensure either ALL or NO methods in this overload return Promise #}
338 {% macro overload_resolution_method(overloads, world_suffix) %} 338 {% macro overload_resolution_method(overloads, world_suffix) %}
339 static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI nfo<v8::Value>& info) 339 static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI nfo<v8::Value>& info)
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 {% for method in conditionally_enabled_methods %} 629 {% for method in conditionally_enabled_methods %}
630 {% filter per_context_enabled(method.per_context_enabled_function) %} 630 {% filter per_context_enabled(method.per_context_enabled_function) %}
631 {% filter exposed(method.exposed_test) %} 631 {% filter exposed(method.exposed_test) %}
632 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction()); 632 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction());
633 {% endfilter %} 633 {% endfilter %}
634 {% endfilter %} 634 {% endfilter %}
635 {% endfor %} 635 {% endfor %}
636 {% endif %} 636 {% endif %}
637 } 637 }
638 {%- endmacro %} 638 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698