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

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

Issue 1046423002: [bindings] Remove History.(push|replace)State custom bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 'conversions.cpp' import v8_value_to_local_cpp_value %} 1 {% from 'conversions.cpp' import v8_value_to_local_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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 v8SetReturnValueNull(info); 266 v8SetReturnValueNull(info);
267 else 267 else
268 {{v8_set_return_value}}; 268 {{v8_set_return_value}};
269 {% else %} 269 {% else %}
270 {{v8_set_return_value}}; 270 {{v8_set_return_value}};
271 {% endif %} 271 {% endif %}
272 {%- endif %}{# None for void #} 272 {%- endif %}{# None for void #}
273 {% if method.is_custom_call_epilogue %} 273 {% if method.is_custom_call_epilogue %}
274 {{v8_class}}::{{method.name}}MethodEpilogueCustom(info, impl); 274 {{v8_class}}::{{method.name}}MethodEpilogueCustom(info, impl);
275 {% endif %} 275 {% endif %}
276 {% if method.clear_cached_attributes %}
277 {% for cached_attribute in method.clear_cached_attributes %}
278 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), info.Holder(), V8HiddenValue ::{{cached_attribute}}(info.GetIsolate()));
279 {% endfor %}
280 {% endif %}
276 {% endmacro %} 281 {% endmacro %}
277 282
278 283
279 {######################################} 284 {######################################}
280 {% macro throw_type_error(method, error_message) %} 285 {% macro throw_type_error(method, error_message) %}
281 {% if method.has_exception_state %} 286 {% if method.has_exception_state %}
282 exceptionState.throwTypeError({{error_message}}); 287 exceptionState.throwTypeError({{error_message}});
283 {{propagate_error_with_exception_state(method)}} 288 {{propagate_error_with_exception_state(method)}}
284 {% elif method.idl_type == 'Promise' %} 289 {% elif method.idl_type == 'Promise' %}
285 v8SetReturnValue(info, ScriptPromise::rejectRaw(ScriptState::current(info.GetIso late()), V8ThrowException::createTypeError(info.GetIsolate(), {{type_error_messa ge(method, error_message)}}))); 290 v8SetReturnValue(info, ScriptPromise::rejectRaw(ScriptState::current(info.GetIso late()), V8ThrowException::createTypeError(info.GetIsolate(), {{type_error_messa ge(method, error_message)}})));
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if method.overloads else 658 if method.overloads else
654 method.runtime_enabled_function) %} 659 method.runtime_enabled_function) %}
655 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 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());
656 {% endfilter %}{# runtime_enabled() #} 661 {% endfilter %}{# runtime_enabled() #}
657 {% endfilter %}{# exposed() #} 662 {% endfilter %}{# exposed() #}
658 {% endfilter %}{# per_context_enabled() #} 663 {% endfilter %}{# per_context_enabled() #}
659 {% endfor %} 664 {% endfor %}
660 {% endif %} 665 {% endif %}
661 } 666 }
662 {%- endmacro %} 667 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698