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

Issue 11827026: Overhaul JSON Schema Compiler to support a number of features required to (Closed)

Created:
7 years, 11 months ago by not at google - send to devlin
Modified:
7 years, 11 months ago
Reviewers:
Yoyo Zhou
CC:
chromium-reviews, vsevik, tzik+watch_chromium.org, sail+watch_chromium.org, Aaron Boodman, pam+watch_chromium.org, yurys, chromium-apps-reviews_chromium.org, kinuko+watch, pfeldman
Visibility:
Public.

Description

Overhaul JSON Schema Compiler to support a number of features required to support the full range of JSON/IDL features, improve the interface of generated code, and improve generated code formatting, notably: * Make "choices" generate a struct containing each possible type, rather than multiple fields with different names plus and enum. This makes it possible to embed choices inside containers - notably within arrays (as in bug). It also improves optional choices detection. * Remove the Any C++ type generated by "any", and model it as a base::Value. * Make "additionalProperties" generated a std::map with the actual types as values, rather than just a DictionaryValue forcing callers to extract types. * Fix enum naming, it was unnecessarily including the namespace as a prefix. R=yoz@chromium.org BUG=162044 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=177361

Patch Set 1 #

Total comments: 55

Patch Set 2 : yoz #

Total comments: 2

Patch Set 3 : rebase #

Patch Set 4 : comments, rebase #

Patch Set 5 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1649 lines, -2176 lines) Patch
M build/json_schema_compile.gypi View 1 2 2 chunks +0 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmarks_api.cc View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/content_settings/content_settings_api.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/context_menus/context_menus_api.cc View 1 2 4 chunks +32 lines, -41 lines 0 comments Download
M chrome/browser/extensions/api/declarative/declarative_rule.h View 1 2 3 4 5 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/declarative/declarative_rule_unittest.cc View 1 2 3 4 7 chunks +28 lines, -21 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc View 1 2 3 4 2 chunks +43 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc View 1 2 3 4 3 chunks +7 lines, -18 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc View 1 2 3 4 6 chunks +26 lines, -71 lines 0 comments Download
M chrome/browser/extensions/api/developer_private/developer_private_api.cc View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/media_galleries/media_galleries_api.cc View 1 2 3 4 2 chunks +6 lines, -10 lines 0 comments Download
M chrome/browser/extensions/api/rtc_private/rtc_private_api.cc View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc View 2 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/system_info_storage/storage_info_provider_linux.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/system_info_storage/storage_info_provider_linux_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/system_info_storage/storage_info_provider_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/system_info_storage/storage_info_provider_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/system_info_storage/storage_info_provider_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/system_info_storage/system_info_storage_apitest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/tab_capture/tab_capture_api.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc View 2 chunks +9 lines, -10 lines 0 comments Download
M chrome/browser/extensions/api/usb/usb_api.cc View 1 2 4 chunks +12 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/web_navigation_api.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/extensions/api/app.json View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/devtools/experimental_audits.json View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/api/runtime.json View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/sync_file_system.idl View 2 chunks +11 lines, -11 lines 0 comments Download
M chrome/common/extensions/api/web_request_internal.json View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/api_data_source.py View 1 2 4 chunks +41 lines, -32 lines 0 comments Download
M chrome/common/extensions/docs/server2/test_data/test_json/expected_test_file.json View 1 2 1 chunk +132 lines, -147 lines 0 comments Download
D tools/json_schema_compiler/any.h View 1 2 3 4 1 chunk +0 lines, -40 lines 0 comments Download
D tools/json_schema_compiler/any.cc View 1 2 3 4 1 chunk +0 lines, -32 lines 0 comments Download
D tools/json_schema_compiler/any_helper.py View 1 chunk +0 lines, -32 lines 0 comments Download
M tools/json_schema_compiler/api_gen_util.gyp View 1 chunk +0 lines, -1 line 0 comments Download
M tools/json_schema_compiler/cc_generator.py View 1 2 3 15 chunks +467 lines, -613 lines 0 comments Download
M tools/json_schema_compiler/code.py View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M tools/json_schema_compiler/cpp_type_generator.py View 1 2 3 9 chunks +104 lines, -169 lines 0 comments Download
M tools/json_schema_compiler/cpp_type_generator_test.py View 1 2 3 3 chunks +30 lines, -104 lines 0 comments Download
M tools/json_schema_compiler/cpp_util.py View 5 chunks +15 lines, -43 lines 0 comments Download
M tools/json_schema_compiler/h_generator.py View 1 2 3 10 chunks +171 lines, -182 lines 0 comments Download
M tools/json_schema_compiler/idl_schema.py View 1 chunk +0 lines, -1 line 0 comments Download
M tools/json_schema_compiler/idl_schema_test.py View 4 chunks +14 lines, -14 lines 0 comments Download
M tools/json_schema_compiler/json_schema.py View 1 chunk +0 lines, -1 line 0 comments Download
M tools/json_schema_compiler/model.py View 1 2 7 chunks +224 lines, -240 lines 0 comments Download
M tools/json_schema_compiler/model_test.py View 2 chunks +21 lines, -23 lines 0 comments Download
M tools/json_schema_compiler/preview.py View 1 chunk +1 line, -1 line 0 comments Download
M tools/json_schema_compiler/schema_util.py View 1 chunk +0 lines, -26 lines 0 comments Download
M tools/json_schema_compiler/schema_util_test.py View 2 chunks +0 lines, -54 lines 0 comments Download
M tools/json_schema_compiler/test/additional_properties.json View 1 chunk +1 line, -1 line 0 comments Download
M tools/json_schema_compiler/test/additional_properties_unittest.cc View 1 3 chunks +13 lines, -19 lines 0 comments Download
M tools/json_schema_compiler/test/any_unittest.cc View 3 chunks +7 lines, -9 lines 0 comments Download
M tools/json_schema_compiler/test/arrays.json View 2 chunks +48 lines, -1 line 0 comments Download
M tools/json_schema_compiler/test/arrays_unittest.cc View 4 chunks +20 lines, -23 lines 0 comments Download
M tools/json_schema_compiler/test/choices_unittest.cc View 4 chunks +49 lines, -50 lines 0 comments Download
M tools/json_schema_compiler/test/enums.json View 1 chunk +1 line, -0 lines 0 comments Download
M tools/json_schema_compiler/test/enums_unittest.cc View 3 chunks +6 lines, -4 lines 0 comments Download
M tools/json_schema_compiler/test/functions_on_types_unittest.cc View 1 4 chunks +13 lines, -13 lines 0 comments Download
M tools/json_schema_compiler/test/idl_schemas_unittest.cc View 1 2 chunks +2 lines, -4 lines 0 comments Download
M tools/json_schema_compiler/test/objects_unittest.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M tools/json_schema_compiler/util.h View 4 chunks +10 lines, -13 lines 0 comments Download
M tools/json_schema_compiler/util.cc View 3 chunks +16 lines, -13 lines 0 comments Download
M tools/json_schema_compiler/util_cc_helper.py View 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
not at google - send to devlin
sorry!
7 years, 11 months ago (2013-01-09 18:23:30 UTC) #1
not at google - send to devlin
friendly ping
7 years, 11 months ago (2013-01-11 15:25:35 UTC) #2
Yoyo Zhou
https://chromiumcodereview.appspot.com/11827026/diff/1/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://chromiumcodereview.appspot.com/11827026/diff/1/tools/json_schema_compiler/cc_generator.py#newcode153 tools/json_schema_compiler/cc_generator.py:153: raise TypeError(type(t)) type(t)? https://chromiumcodereview.appspot.com/11827026/diff/1/tools/json_schema_compiler/cc_generator.py#newcode171 tools/json_schema_compiler/cc_generator.py:171: 'const base::Value& value, %(name)s* ...
7 years, 11 months ago (2013-01-15 01:49:24 UTC) #3
not at google - send to devlin
I'm going to rebase now, then write some more tests. https://codereview.chromium.org/11827026/diff/1/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://codereview.chromium.org/11827026/diff/1/tools/json_schema_compiler/cc_generator.py#newcode153 ...
7 years, 11 months ago (2013-01-15 21:47:27 UTC) #4
Yoyo Zhou
LGTM https://chromiumcodereview.appspot.com/11827026/diff/1/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://chromiumcodereview.appspot.com/11827026/diff/1/tools/json_schema_compiler/cc_generator.py#newcode153 tools/json_schema_compiler/cc_generator.py:153: raise TypeError(type(t)) On 2013/01/15 21:47:27, kalman wrote: > ...
7 years, 11 months ago (2013-01-16 23:14:39 UTC) #5
not at google - send to devlin
https://codereview.chromium.org/11827026/diff/1/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://codereview.chromium.org/11827026/diff/1/tools/json_schema_compiler/cc_generator.py#newcode171 tools/json_schema_compiler/cc_generator.py:171: 'const base::Value& value, %(name)s* out) {') On 2013/01/16 23:14:39, ...
7 years, 11 months ago (2013-01-17 00:11:49 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kalman@chromium.org/11827026/20006
7 years, 11 months ago (2013-01-17 00:16:54 UTC) #7
commit-bot: I haz the power
Failed to apply patch for chrome/browser/extensions/api/declarative_webrequest/webrequest_action.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 11 months ago (2013-01-17 03:33:30 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kalman@chromium.org/11827026/27005
7 years, 11 months ago (2013-01-17 05:45:03 UTC) #9
commit-bot: I haz the power
7 years, 11 months ago (2013-01-17 06:41:09 UTC) #10
Retried try job too often on linux_chromeos for step(s) unit_tests

Powered by Google App Engine
This is Rietveld 408576698