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

Unified Diff: mojo/public/tools/bindings/pylib/mojom/generate/generator.py

Issue 459873003: Mojom generator: move Is.*Kind() functions into module.py and use them from all mojom_.*_generator.… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix java compilation Created 6 years, 4 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/pylib/mojom/generate/generator.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/generator.py b/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
index c818455070a7831be9ba0a8b6d02d38a9ed3c6da..eb433bfb801a0fb68fa439f7a17f3788047b8cda 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
@@ -36,37 +36,10 @@ def GetDataHeader(exported, struct):
return struct
def ExpectedArraySize(kind):
- if isinstance(kind, mojom.FixedArray):
+ if mojom.IsFixedArrayKind(kind):
return kind.length
return 0
-def IsArrayKind(kind):
- return isinstance(kind, (mojom.Array, mojom.FixedArray))
-
-def IsStringKind(kind):
- return kind.spec == 's'
-
-def IsEnumKind(kind):
- return isinstance(kind, mojom.Enum)
-
-def IsObjectKind(kind):
- return isinstance(kind, (mojom.Struct, mojom.Array, mojom.FixedArray)) or \
- IsStringKind(kind)
-
-def IsHandleKind(kind):
- return kind.spec.startswith('h') or \
- isinstance(kind, mojom.Interface) or \
- isinstance(kind, mojom.InterfaceRequest)
-
-def IsInterfaceKind(kind):
- return isinstance(kind, mojom.Interface)
-
-def IsInterfaceRequestKind(kind):
- return isinstance(kind, mojom.InterfaceRequest)
-
-def IsMoveOnlyKind(kind):
- return IsObjectKind(kind) or IsHandleKind(kind)
-
def StudlyCapsToCamel(studly):
return studly[0].lower() + studly[1:]
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_js_generator.py ('k') | mojo/public/tools/bindings/pylib/mojom/generate/module.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698