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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 1837293004: [Extensions] Support choices in autogenerated movable types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar tests Created 4 years, 9 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
« no previous file with comments | « no previous file | tools/json_schema_compiler/test/objects_movable.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cc_generator.py
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 9bfd3e6c4e9b28f8686341cd352a0620829d4d07..059166c3477d27ab09111a40fc778237ce8b5430 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -233,6 +233,11 @@ class _Generator(object):
else:
raise TypeError(t)
+ if type_.property_type == PropertyType.CHOICES:
+ for choice in type_.choices:
+ prop_name = 'as_%s' % choice.unix_name
+ props.append(move_str % (prop_name, prop_name))
+
if (type_.property_type == PropertyType.OBJECT and
type_.additional_properties is not None):
if type_.additional_properties.property_type == PropertyType.ANY:
« no previous file with comments | « no previous file | tools/json_schema_compiler/test/objects_movable.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698