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

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..98e48d9e7db706922197caddc43ed9cf6e217e77 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) %}
+const char* validValues[] = {
haraken 2015/03/31 06:11:16 Add static?
bashi 2015/04/01 00:17:31 Done.
+{% for enum_value in enum_values %}
+ "{{enum_value}}",
+{% endfor %}
+};
+{%-endmacro %}

Powered by Google App Engine
This is Rietveld 408576698