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

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

Issue 692443002: 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 {% endif %} 301 {% endif %}
302 {% endmacro %} 302 {% endmacro %}
303 303
304 304
305 {######################################} 305 {######################################}
306 {% macro throw_type_error(method, error_message) %} 306 {% macro throw_type_error(method, error_message) %}
307 {% if method.has_exception_state %} 307 {% if method.has_exception_state %}
308 exceptionState.throwTypeError({{error_message}}); 308 exceptionState.throwTypeError({{error_message}});
309 {{throw_from_exception_state(method)}}; 309 {{throw_from_exception_state(method)}};
310 {% elif method.idl_type == 'Promise' %} 310 {% elif method.idl_type == 'Promise' %}
311 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), V8ThrowExcept ion::createTypeError({{type_error_message(method, error_message)}}, info.GetIsol ate()))); 311 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), V8ThrowExcept ion::createTypeError(info.GetIsolate(), {{type_error_message(method, error_messa ge)}})));
312 {% else %} 312 {% else %}
313 V8ThrowException::throwTypeError({{type_error_message(method, error_message)}}, info.GetIsolate()); 313 V8ThrowException::throwTypeError({{type_error_message(method, error_message)}}, info.GetIsolate());
314 {% endif %}{# method.has_exception_state #} 314 {% endif %}{# method.has_exception_state #}
315 {% endmacro %} 315 {% endmacro %}
316 316
317 317
318 {######################################} 318 {######################################}
319 {% macro type_error_message(method, error_message) %} 319 {% macro type_error_message(method, error_message) %}
320 {% if method.is_constructor %} 320 {% if method.is_constructor %}
321 ExceptionMessages::failedToConstruct("{{interface_name}}", {{error_message}}) 321 ExceptionMessages::failedToConstruct("{{interface_name}}", {{error_message}})
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 {% for method in conditionally_enabled_methods %} 656 {% for method in conditionally_enabled_methods %}
657 {% filter per_context_enabled(method.per_context_enabled_function) %} 657 {% filter per_context_enabled(method.per_context_enabled_function) %}
658 {% filter exposed(method.exposed_test) %} 658 {% filter exposed(method.exposed_test) %}
659 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()); 659 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());
660 {% endfilter %} 660 {% endfilter %}
661 {% endfilter %} 661 {% endfilter %}
662 {% endfor %} 662 {% endfor %}
663 {% endif %} 663 {% endif %}
664 } 664 }
665 {%- endmacro %} 665 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8ThrowException.cpp ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698