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

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed)

Created:
8 years, 5 months ago by Matt Tytel
Modified:
8 years, 5 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org, pam+watch_chromium.org, cduvall
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

JSON Schema Compiler: Add event compilation and allow multiple parameters to callbacks Compiles events to objects that look similar to this: namespace OnObjectFired { struct SomeObject { ~SomeObject(); SomeObject(); enum State { STATE_FOO, STATE_BAR, STATE_BAZ, }; static scoped_ptr<Value> CreateEnumValue(State state); State state; // Returns a new DictionaryValue representing the serialized form of this // SomeObject object. Passes ownership to caller. scoped_ptr<DictionaryValue> ToValue() const; private: DISALLOW_COPY_AND_ASSIGN(SomeObject); }; Value* Create(const SomeObject& some_object); }; BUG=133757, 135237 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=146899

Patch Set 1 #

Total comments: 1

Patch Set 2 : Hey this change fixed returning enums. Added tests. #

Patch Set 3 : Added more testing for event compilation. #

Total comments: 1

Patch Set 4 : Added missing test. #

Patch Set 5 : Synced. #

Total comments: 32

Patch Set 6 : Reworked Create functions and lots of tests. #

Total comments: 30

Patch Set 7 : Reworked the tests and review fixes. #

Total comments: 5

Patch Set 8 : Tested GetAllPossibleParameterLists better. #

Total comments: 4

Patch Set 9 : Changed return type of Create to scoped_ptr<ListValue> and s/Result/Results/g. #

Patch Set 10 : Synced and a small test fix. #

Patch Set 11 : Removed value_builder from tests. #

Patch Set 12 : Synced. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+729 lines, -257 lines) Patch
M chrome/browser/chromeos/extensions/file_browser_handler_api.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/alarms/alarms_api.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative/declarative_api.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/dns/dns_api.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/permissions/permissions_api.cc View 1 2 3 4 5 6 7 8 5 chunks +9 lines, -9 lines 0 comments Download
M chrome/browser/extensions/api/record/record_api.cc View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/usb/usb_api.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/web_navigation/web_navigation_api.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/storage.json View 1 2 3 4 5 3 chunks +4 lines, -4 lines 0 comments Download
M tools/json_schema_compiler/cc_generator.py View 1 2 3 4 5 6 7 8 5 chunks +47 lines, -38 lines 0 comments Download
M tools/json_schema_compiler/cpp_type_generator.py View 1 2 3 4 5 6 1 chunk +14 lines, -5 lines 0 comments Download
M tools/json_schema_compiler/cpp_type_generator_test.py View 1 2 3 4 5 6 7 8 2 chunks +25 lines, -3 lines 0 comments Download
M tools/json_schema_compiler/h_generator.py View 1 2 3 4 5 6 7 8 6 chunks +54 lines, -28 lines 0 comments Download
M tools/json_schema_compiler/model.py View 1 2 3 4 5 6 10 chunks +26 lines, -43 lines 0 comments Download
M tools/json_schema_compiler/model_test.py View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download
M tools/json_schema_compiler/schema_bundle_generator.py View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M tools/json_schema_compiler/test/additional_properties_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -11 lines 0 comments Download
M tools/json_schema_compiler/test/any.json View 1 chunk +13 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/arrays_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +20 lines, -21 lines 0 comments Download
A + tools/json_schema_compiler/test/callbacks.json View 1 2 3 4 5 2 chunks +31 lines, -20 lines 0 comments Download
A tools/json_schema_compiler/test/callbacks_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +35 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/choices.json View 1 2 3 4 5 1 chunk +29 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/choices_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +13 lines, -13 lines 0 comments Download
M tools/json_schema_compiler/test/crossref_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -2 lines 0 comments Download
M tools/json_schema_compiler/test/enums.json View 1 2 3 4 5 2 chunks +72 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/enums_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +56 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/forbidden.json View 1 2 3 4 5 6 7 1 chunk +39 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/functions_on_types_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -6 lines 0 comments Download
M tools/json_schema_compiler/test/idl_schemas_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +13 lines, -8 lines 0 comments Download
M tools/json_schema_compiler/test/json_schema_compiler_tests.gyp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M tools/json_schema_compiler/test/objects.json View 1 2 3 4 5 1 chunk +79 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/objects_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -10 lines 0 comments Download
M tools/json_schema_compiler/test/simple_api.json View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/test/simple_api_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +50 lines, -12 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Matt Tytel
Still working on fixing a hack and adding tests. https://chromiumcodereview.appspot.com/10701012/diff/1/tools/json_schema_compiler/h_generator.py File tools/json_schema_compiler/h_generator.py (right): https://chromiumcodereview.appspot.com/10701012/diff/1/tools/json_schema_compiler/h_generator.py#newcode299 tools/json_schema_compiler/h_generator.py:299: ...
8 years, 5 months ago (2012-06-27 23:11:47 UTC) #1
Matt Tytel
kalman++, event compilation is working. there is one slight hack I commented on in the ...
8 years, 5 months ago (2012-06-28 19:59:11 UTC) #2
Matt Tytel
https://chromiumcodereview.appspot.com/10701012/diff/7001/tools/json_schema_compiler/test/enums_unittest.cc File tools/json_schema_compiler/test/enums_unittest.cc (right): https://chromiumcodereview.appspot.com/10701012/diff/7001/tools/json_schema_compiler/test/enums_unittest.cc#newcode150 tools/json_schema_compiler/test/enums_unittest.cc:150: TEST(JsonSchemaCompilerEnumsTest, OnEnumFiredCreate) { Erp. Fixing.
8 years, 5 months ago (2012-06-29 01:15:52 UTC) #3
Matt Tytel
ready for your review.
8 years, 5 months ago (2012-06-29 20:57:10 UTC) #4
Matt Tytel
https://chromiumcodereview.appspot.com/10701012/diff/10002/tools/json_schema_compiler/h_generator.py File tools/json_schema_compiler/h_generator.py (right): https://chromiumcodereview.appspot.com/10701012/diff/10002/tools/json_schema_compiler/h_generator.py#newcode299 tools/json_schema_compiler/h_generator.py:299: if prop.from_json: On alternative to this is to define ...
8 years, 5 months ago (2012-06-29 23:06:40 UTC) #5
not at google - send to devlin
http://codereview.chromium.org/10701012/diff/10002/chrome/common/extensions/api/storage.json File chrome/common/extensions/api/storage.json (right): http://codereview.chromium.org/10701012/diff/10002/chrome/common/extensions/api/storage.json#newcode164 chrome/common/extensions/api/storage.json:164: "name": "storageNamespace", I always wanted to change references to ...
8 years, 5 months ago (2012-07-03 14:21:39 UTC) #6
Matt Tytel
Ready for more reveiew, but still working on prettying up the tests. https://chromiumcodereview.appspot.com/10701012/diff/10002/chrome/common/extensions/api/storage.json File chrome/common/extensions/api/storage.json ...
8 years, 5 months ago (2012-07-11 02:08:50 UTC) #7
not at google - send to devlin
Cool, looking good. Really looking forward to this change going in (and events being rendered ...
8 years, 5 months ago (2012-07-11 07:22:06 UTC) #8
Matt Tytel
Got a little carried away with the value_builders.. https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py#newcode654 tools/json_schema_compiler/cc_generator.py:654: c.Sblock('ListValue* ...
8 years, 5 months ago (2012-07-12 03:07:56 UTC) #9
Matt Tytel
https://chromiumcodereview.appspot.com/10701012/diff/8015/tools/json_schema_compiler/test/forbidden.json File tools/json_schema_compiler/test/forbidden.json (right): https://chromiumcodereview.appspot.com/10701012/diff/8015/tools/json_schema_compiler/test/forbidden.json#newcode1 tools/json_schema_compiler/test/forbidden.json:1: [ Didn't want people to think this was a ...
8 years, 5 months ago (2012-07-12 03:31:28 UTC) #10
not at google - send to devlin
lgtm https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py#newcode654 tools/json_schema_compiler/cc_generator.py:654: c.Sblock('ListValue* %(function_scope)s::Create(%(declaration_list)s) {') On 2012/07/12 03:07:56, Matt Tytel ...
8 years, 5 months ago (2012-07-12 03:36:49 UTC) #11
Matt Tytel
Should have just done the scoped_ptr<ListValue> switch earlier.. https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py#newcode654 tools/json_schema_compiler/cc_generator.py:654: c.Sblock('ListValue* ...
8 years, 5 months ago (2012-07-13 02:34:43 UTC) #12
not at google - send to devlin
https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://chromiumcodereview.appspot.com/10701012/diff/6011/tools/json_schema_compiler/cc_generator.py#newcode654 tools/json_schema_compiler/cc_generator.py:654: c.Sblock('ListValue* %(function_scope)s::Create(%(declaration_list)s) {') On 2012/07/13 02:34:43, Matt Tytel wrote: ...
8 years, 5 months ago (2012-07-13 02:40:32 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtytel@chromium.org/10701012/16006
8 years, 5 months ago (2012-07-13 03:02:54 UTC) #14
commit-bot: I haz the power
Try job failure for 10701012-16006 (retry) on mac_rel for steps "unit_tests, check_deps". It's a second ...
8 years, 5 months ago (2012-07-13 03:45:18 UTC) #15
Matt Tytel
Well I'm not sure how to include the value_builder without the dependencies freaking out. If ...
8 years, 5 months ago (2012-07-13 23:53:39 UTC) #16
not at google - send to devlin
Could always copy ValueBuilder into json_schema_compiler. Easier than rewriting all the tests. Move to base ...
8 years, 5 months ago (2012-07-15 22:58:54 UTC) #17
not at google - send to devlin
But I see you've already removed it, so never mind :)
8 years, 5 months ago (2012-07-15 22:59:12 UTC) #18
Matt Tytel
Yea, I'll make another CL if/when value_builder goes into base.
8 years, 5 months ago (2012-07-16 20:06:55 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtytel@chromium.org/10701012/28001
8 years, 5 months ago (2012-07-16 20:27:57 UTC) #20
commit-bot: I haz the power
8 years, 5 months ago (2012-07-16 21:47:26 UTC) #21
Change committed as 146899

Powered by Google App Engine
This is Rietveld 408576698