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

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

Issue 1047993002: bindings: Add validation for enum Sequence or Array (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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/conversions.cpp
diff --git a/Source/bindings/templates/conversions.cpp b/Source/bindings/templates/conversions.cpp
index cb48705d6c57b8ea7919d39c604f3986987ec2f3..fdf9d7815aed9abea7f9c0e074b5894594c9be78 100644
--- a/Source/bindings/templates/conversions.cpp
+++ b/Source/bindings/templates/conversions.cpp
@@ -29,3 +29,12 @@ if ({{item.check_expression}})
{% endif %}{# item.check_expression #}
{% endif %}{# item.error_message #}
{% endmacro %}
+
+
+{% macro declare_enum_validation_variable(enum_values) %}
+static const char* validValues[] = {
+{% for enum_value in enum_values %}
+ "{{enum_value}}",
+{% endfor %}
+};
+{%-endmacro %}

Powered by Google App Engine
This is Rietveld 408576698