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

Unified Diff: tools/json_schema_compiler/cpp_type_generator.py

Issue 10824002: JSON Schema Compiler supports functions as PropertyTypes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 6 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
« no previous file with comments | « tools/json_schema_compiler/cc_generator.py ('k') | tools/json_schema_compiler/cpp_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cpp_type_generator.py
diff --git a/tools/json_schema_compiler/cpp_type_generator.py b/tools/json_schema_compiler/cpp_type_generator.py
index f398c752ec04e4348e1188e6cc89d6730a55b93b..0ccda1afe497bbd41ab088f94d1f599c86d31280 100644
--- a/tools/json_schema_compiler/cpp_type_generator.py
+++ b/tools/json_schema_compiler/cpp_type_generator.py
@@ -152,6 +152,11 @@ class CppTypeGenerator(object):
cpp_type = any_helper.ANY_CLASS
elif prop.type_ == PropertyType.OBJECT:
cpp_type = cpp_util.Classname(prop.name)
+ elif prop.type_ == PropertyType.FUNCTION:
+ # Functions come into the json schema compiler as empty objects. We can
+ # record these as empty DictionaryValue's so that we know if the function
+ # was passed in or not.
+ cpp_type = 'base::DictionaryValue'
elif prop.type_ == PropertyType.ARRAY:
item_type = prop.item_type
if item_type.type_ == PropertyType.REF:
« no previous file with comments | « tools/json_schema_compiler/cc_generator.py ('k') | tools/json_schema_compiler/cpp_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698