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

Unified Diff: mojo/public/tools/bindings/generators/mojom_cpp_generator.py

Issue 1065653006: Array and map members for unions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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/mojom_cpp_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
index 35dec210775e35409a0d65e38aa65a39811313d3..dbe977d6a4fa4c818644b2c51ccb31978c1df7c7 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -228,7 +228,8 @@ def GetCppFieldType(kind):
return _kind_to_cpp_type[kind]
def GetUnionGetterReturnType(kind):
- if mojom.IsStructKind(kind):
+ if (mojom.IsStructKind(kind) or mojom.IsArrayKind(kind) or
+ mojom.IsMapKind(kind)):
return "%s&" % GetCppWrapperType(kind)
return GetCppResultWrapperType(kind)

Powered by Google App Engine
This is Rietveld 408576698