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

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

Issue 1517043004: [mojo] Add typemap and variant support to generators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pickle3
Patch Set: set proper upstream Created 5 years 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 8b153a5c1d9ffc14fc4267803bd3ed010e68a0b8..4c632702d67844693eb266087b14a024106ed23f 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -429,6 +429,7 @@ class Generator(generator.Generator):
"structs": self.GetStructs(),
"unions": self.GetUnions(),
"interfaces": self.GetInterfaces(),
+ "variant": self.variant,
}
@UseJinja("cpp_templates/module.h.tmpl", filters=cpp_filters)
@@ -444,9 +445,10 @@ class Generator(generator.Generator):
return self.GetJinjaExports()
def GenerateFiles(self, args):
+ suffix = "-%s" % self.variant if self.variant else ""
self.Write(self.GenerateModuleHeader(),
- self.MatchMojomFilePath("%s.h" % self.module.name))
+ self.MatchMojomFilePath("%s%s.h" % (self.module.name, suffix)))
self.Write(self.GenerateModuleInternalHeader(),
- self.MatchMojomFilePath("%s-internal.h" % self.module.name))
+ self.MatchMojomFilePath("%s%s-internal.h" % (self.module.name, suffix)))
self.Write(self.GenerateModuleSource(),
- self.MatchMojomFilePath("%s.cc" % self.module.name))
+ self.MatchMojomFilePath("%s%s.cc" % (self.module.name, suffix)))

Powered by Google App Engine
This is Rietveld 408576698