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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl

Issue 1618963006: Mojo C++ bindings: support enum validation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
index 52aafacc0456f17515b206962e3c5f2ccda05923..1fd9cf38cd2f513807a1e511fe9d90c93b4e1236 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
@@ -33,7 +33,7 @@ class {{struct.name}}_Reader {
// TODO(rockot): Support reading associated kinds. ({{name}}() omitted)
{%- elif kind|is_enum_kind %}
{{kind|cpp_result_type}} {{name}}() const {
- return static_cast<{{kind|cpp_result_type}}>(data_->{{name}});
+ return static_cast<{{kind|cpp_result_type}}>(data_->{{name}}.value);
}
{%- else %}
{{kind|cpp_result_type}} {{name}}() const { return data_->{{name}}; }

Powered by Google App Engine
This is Rietveld 408576698