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

Unified Diff: tools/json_schema_compiler/h_generator.py

Issue 10825029: Added JSON schema compiler support for serialized types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Indent typo fix Created 8 years, 5 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: tools/json_schema_compiler/h_generator.py
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py
index 03879ca0ac73db84e99de049f76230e615850132..e1d9f48b0fa3de3ebefb51f377e172fa6c2eb78d 100644
--- a/tools/json_schema_compiler/h_generator.py
+++ b/tools/json_schema_compiler/h_generator.py
@@ -159,8 +159,8 @@ class HGenerator(object):
if prop.description:
c.Comment(prop.description)
(c.Append('%s %s;' % (
- self._cpp_type_generator.GetType(prop, wrap_optional=True),
- prop.unix_name))
+ self._cpp_type_generator.GetCompiledType(prop, wrap_optional=True),
+ prop.unix_name))
.Append()
)
return c
@@ -183,8 +183,8 @@ class HGenerator(object):
c.Comment(type_.description)
c.Append('typedef std::vector<%(item_type)s> %(classname)s;')
c.Substitute({'classname': classname, 'item_type':
- self._cpp_type_generator.GetType(type_.item_type,
- wrap_optional=True)})
+ self._cpp_type_generator.GetCompiledType(type_.item_type,
+ wrap_optional=True)})
elif type_.type_ == PropertyType.STRING:
if type_.description:
c.Comment(type_.description)
@@ -294,7 +294,7 @@ class HGenerator(object):
[choice.type_.name for choice in prop.choices.values()]))
c.Concat(self._GeneratePropertyStructures(prop.choices.values()))
elif prop.type_ == PropertyType.ENUM:
- enum_name = self._cpp_type_generator.GetType(prop)
+ enum_name = self._cpp_type_generator.GetCompiledType(prop)
c.Concat(self._GenerateEnumDeclaration(
enum_name,
prop,
@@ -339,7 +339,7 @@ class HGenerator(object):
if param.description:
c.Comment(param.description)
declaration_list.append('const %s' % cpp_util.GetParameterDeclaration(
- param, self._cpp_type_generator.GetType(param)))
+ param, self._cpp_type_generator.GetCompiledType(param)))
c.Append('scoped_ptr<base::ListValue> Create(%s);' %
', '.join(declaration_list))
if generate_to_json:

Powered by Google App Engine
This is Rietveld 408576698