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

Unified Diff: Source/bindings/templates/methods.cpp

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/templates/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index ed6fb0da6764dcdab0b2a0223d1d869c2e145627..31e9780c90bc961c12b06d6c151346079799f2f0 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -238,7 +238,7 @@ if (!{{method.cpp_value}})
{{cpp_value}};
{% elif method.is_constructor %}
{{method.cpp_type}} impl = {{cpp_value}};
-{% elif method.use_local_result and not method.union_arguments %}
+{% elif method.use_local_result %}
{{method.cpp_type}} result = {{cpp_value}};
{% endif %}
{# Post-call #}
@@ -251,8 +251,6 @@ if (exceptionState.hadException()) {
{# Set return value #}
{% if method.is_constructor %}
{{generate_constructor_wrapper(method)}}
-{%- elif method.union_arguments %}
-{{union_type_method_call_and_set_return_value(method)}}
{%- elif v8_set_return_value %}
{% if method.is_explicit_nullable %}
if (result.isNull())
@@ -278,31 +276,6 @@ if (info.Length() >= {{argument_index}} + 1 && listener && !impl->toNode())
{######################################}
-{% macro union_type_method_call_and_set_return_value(method) %}
-{% for argument in method.union_arguments %}
-{{argument.cpp_type}} {{argument.cpp_value}}{{argument.cpp_type_initializer}};
-{% endfor %}
-{{method.cpp_value}};
-{% if method.is_null_expression %}{# used by getters #}
-if ({{method.is_null_expression}})
- return;
-{% endif %}
-{% for argument in method.union_arguments %}
-if ({{argument.null_check_value}}) {
- {{argument.v8_set_return_value}};
- return;
-}
-{% endfor %}
-{# Fall back to null if none of the union members results are returned #}
-{% if method.is_null_expression %}
-ASSERT_NOT_REACHED();
-{% else %}
-v8SetReturnValueNull(info);
-{% endif %}
-{% endmacro %}
-
-
-{######################################}
{% macro throw_type_error(method, error_message) %}
{% if method.has_exception_state %}
exceptionState.throwTypeError({{error_message}});

Powered by Google App Engine
This is Rietveld 408576698