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

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

Issue 1618963006: Mojo C++ bindings: support enum validation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/tools/bindings/pylib/mojom/generate/module.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/module.py b/mojo/public/tools/bindings/pylib/mojom/generate/module.py
index 43476097216f233cec5b0249174f5d618a10ad7b..cb0a0108eaeda79c35b9beaaacdd195ab4799fbd 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/module.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/module.py
@@ -131,6 +131,7 @@ PRIMITIVES = (
ATTRIBUTE_MIN_VERSION = 'MinVersion'
+ATTRIBUTE_EXTENSIBLE = 'Extensible'
class NamedValue(object):
@@ -445,6 +446,11 @@ class Enum(Kind):
self.fields = []
self.attributes = attributes
+ @property
+ def extensible(self):
+ return self.attributes.get(ATTRIBUTE_EXTENSIBLE, False) \
+ if self.attributes else False
+
class Module(object):
def __init__(self, name=None, namespace=None, attributes=None):
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_cpp_generator.py ('k') | ui/arc/notification/arc_notification_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698