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

Unified Diff: mojo/public/bindings/generators/mojom_generator.py

Issue 138143003: Support default values for POD struct fields in mojom IDL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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/bindings/generators/mojom_generator.py
diff --git a/mojo/public/bindings/generators/mojom_generator.py b/mojo/public/bindings/generators/mojom_generator.py
index 6470dc047c3180ceb85ce59b1a17900373660c92..de02d1c25436f3d45a7aa3f1c17aea083815d432 100644
--- a/mojo/public/bindings/generators/mojom_generator.py
+++ b/mojo/public/bindings/generators/mojom_generator.py
@@ -25,8 +25,11 @@ def GetStructInfo(exported, struct):
struct.exported = exported
return struct
+def IsStringKind(kind):
+ return kind.spec == 's'
+
def IsObjectKind(kind):
- return isinstance(kind, (mojom.Struct, mojom.Array)) or kind.spec == 's'
+ return isinstance(kind, (mojom.Struct, mojom.Array)) or IsStringKind(kind)
def IsHandleKind(kind):
return kind.spec.startswith('h')

Powered by Google App Engine
This is Rietveld 408576698