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

Issue 10824002: JSON Schema Compiler supports functions as PropertyTypes. (Closed)

Created:
8 years, 5 months ago by chebert
Modified:
8 years, 5 months ago
CC:
chromium-reviews, pam+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

JSON Schema Compiler supports functions as PropertyTypes. Before, the compiler raised an exception when a function was used as a property, which happens whenever a function is passed as a parameter. The solution presented here is to create a bool has_<function_name> to allow the hand-written C++ code to know whether or not the function was passed in. BUG=138850 TEST=function_as_parameter Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=148480

Patch Set 1 #

Patch Set 2 : bool function; becomes bool has_function; #

Total comments: 23

Patch Set 3 : replaced has_function with an empty dict if the function is there #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 1

Patch Set 6 : 6 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -12 lines) Patch
M chrome/chrome_tests.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M tools/json_schema_compiler/cc_generator.py View 1 2 3 chunks +10 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/cpp_type_generator.py View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/cpp_util.py View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M tools/json_schema_compiler/h_generator.py View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M tools/json_schema_compiler/model.py View 1 2 3 chunks +3 lines, -10 lines 0 comments Download
A tools/json_schema_compiler/test/functions_as_parameters.json View 1 chunk +28 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/functions_as_parameters_unittest.cc View 1 2 1 chunk +94 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/json_schema_compiler_tests.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
chebert
This is another change needed by the context_menus api.
8 years, 5 months ago (2012-07-25 00:12:48 UTC) #1
not at google - send to devlin
nice one https://chromiumcodereview.appspot.com/10824002/diff/2001/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://chromiumcodereview.appspot.com/10824002/diff/2001/tools/json_schema_compiler/cc_generator.py#newcode219 tools/json_schema_compiler/cc_generator.py:219: if prop.type_ == PropertyType.FUNCTION: Comment why you're ...
8 years, 5 months ago (2012-07-25 01:32:33 UTC) #2
chebert
The empty dictionary value was a much better idea. The code comes out way cleaner. ...
8 years, 5 months ago (2012-07-25 18:38:30 UTC) #3
not at google - send to devlin
lgtm, nice. https://chromiumcodereview.appspot.com/10824002/diff/12001/tools/json_schema_compiler/h_generator.py File tools/json_schema_compiler/h_generator.py (right): https://chromiumcodereview.appspot.com/10824002/diff/12001/tools/json_schema_compiler/h_generator.py#newcode164 tools/json_schema_compiler/h_generator.py:164: ) need the parens? btw the line ...
8 years, 5 months ago (2012-07-26 00:01:02 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hebert.christopherj@chromium.org/10824002/10002
8 years, 5 months ago (2012-07-26 00:07:50 UTC) #5
commit-bot: I haz the power
Presubmit check for 10824002-10002 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 5 months ago (2012-07-26 00:08:01 UTC) #6
Nico
lgtm
8 years, 5 months ago (2012-07-26 00:12:19 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hebert.christopherj@chromium.org/10824002/10002
8 years, 5 months ago (2012-07-26 00:12:48 UTC) #8
commit-bot: I haz the power
8 years, 5 months ago (2012-07-26 02:18:16 UTC) #9
Change committed as 148480

Powered by Google App Engine
This is Rietveld 408576698