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

Unified Diff: tools/json_schema_compiler/model.py

Issue 10824002: JSON Schema Compiler supports functions as PropertyTypes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: bool function; becomes bool has_function; 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/model.py
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index 5453e11c40a11a6abe9425d5df2a8e997ab726b5..9bdf4048b61f5ee954e380d969ade952accf622f 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -212,6 +212,8 @@ class Property(object):
# self.properties will already have some value from |_AddProperties|.
self.properties.update(type_.properties)
self.functions = type_.functions
+ elif json_type == 'function':
+ self.type_ = PropertyType.FUNCTION
elif json_type == 'binary':
self.type_ = PropertyType.BINARY
else:
@@ -293,6 +295,7 @@ class PropertyType(object):
REF = _Info(False, "REF")
CHOICES = _Info(False, "CHOICES")
OBJECT = _Info(False, "OBJECT")
+ FUNCTION = _Info(False, "FUNCTION")
BINARY = _Info(False, "BINARY")
ANY = _Info(False, "ANY")
ADDITIONAL_PROPERTIES = _Info(False, "ADDITIONAL_PROPERTIES")
@@ -358,8 +361,8 @@ def _AddProperties(model, json, from_json=False, from_client=False):
# the instances of functions-on-properties in the extension APIs are all
# handled in pure Javascript on the render process (and .: never reach
# C++ let alone the browser).
- if property_json.get('type') == 'function':
- continue
+ #if property_json.get('type') == 'function':
+ #continue
not at google - send to devlin 2012/07/25 01:32:33 delete this and the whole comment above, it's no l
chebert 2012/07/25 18:38:30 Done.
model.properties[name] = Property(
model,
name,

Powered by Google App Engine
This is Rietveld 408576698