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

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

Issue 1375313006: For c++, Generate enum classes instead of enum from mojom. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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: mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
index 05305e19ca0e619c163ae47a944e6454c0353be6..e349f856989c47de9744f239d9fd0b527ed4ad8a 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
@@ -15,6 +15,7 @@
#include "{{module.path}}.h"
#include <math.h>
+#include <ostream>
#include "mojo/public/cpp/bindings/lib/array_serialization.h"
#include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
@@ -80,8 +81,10 @@ const uint32_t {{method_name}} = {{method.ordinal}};
{#--- Enums #}
{%- from "enum_macros.tmpl" import is_valid_enum_def -%}
+{%- from "enum_macros.tmpl" import global_enum_operators_def -%}
{%- for enum in enums -%}
{{is_valid_enum_def(enum, class_name='')}}
+ {{global_enum_operators_def(enum, class_name='')}}
{%- endfor %}
{#--- Struct Constants #}

Powered by Google App Engine
This is Rietveld 408576698