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

Issue 1051563002: Support JSON Schema properties with values in the JSON Schema Compiler. (Closed)

Created:
5 years, 8 months ago by not at google - send to devlin
Modified:
5 years, 8 months ago
Reviewers:
Devlin, Red Daly
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support JSON Schema properties with values in the JSON Schema Compiler. This brings the Extension IDL Schema feature set closer to the JSON Schema feature set. In particular, the MDNS API needs this functionality. Unfortunately the PPAPI IDL parser doesn't support WebIDL's "const" keyword, which would be the right way to do this. Instead we fake it (though, consistent with functions and events); to define a JSON Schema property, IDL Schemas declare a 'Properties' namespace populated with no-argument functions, annotating each function with the value they should be mapped to. For example, this IDL: namespace myApi { interface Properties { // A constant. [value=42] static long someConstant(); }; }; will generate this JSON Schema: { "namespace": "myApi", "properties": { "someConstant": { "value": "42", "description": "A constant", "type": "integer", } } } and finally, an integer myApi::some_constant equal to 42 in C++. R=rdevlin.cronin@chromium.org Committed: https://crrev.com/d94f954f5e1c32e7be85e2ba835a143fd388a0d8 Cr-Commit-Position: refs/heads/master@{#323401}

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : better factoring / testing #

Total comments: 15

Patch Set 4 : comments #

Patch Set 5 : assertr #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -19 lines) Patch
M tools/json_schema_compiler/cpp_type_generator.py View 1 2 1 chunk +8 lines, -4 lines 0 comments Download
M tools/json_schema_compiler/idl_schema.py View 1 2 3 4 7 chunks +66 lines, -15 lines 0 comments Download
M tools/json_schema_compiler/idl_schema_test.py View 1 2 1 chunk +24 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/test/idl_properties.idl View 1 2 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
not at google - send to devlin
How's your python?
5 years, 8 months ago (2015-03-31 22:11:09 UTC) #1
Devlin
https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py#newcode208 tools/json_schema_compiler/idl_schema.py:208: 'with a non-void return type') including "name" here would ...
5 years, 8 months ago (2015-04-01 22:46:20 UTC) #2
Red Daly
Thanks for implementing this! https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py#newcode416 tools/json_schema_compiler/idl_schema.py:416: self.properties[name] = prop Does the ...
5 years, 8 months ago (2015-04-01 23:12:54 UTC) #4
not at google - send to devlin
https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py#newcode208 tools/json_schema_compiler/idl_schema.py:208: 'with a non-void return type') On 2015/04/01 22:46:19, Devlin ...
5 years, 8 months ago (2015-04-01 23:44:01 UTC) #5
Devlin
https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py#newcode416 tools/json_schema_compiler/idl_schema.py:416: self.properties[name] = prop On 2015/04/01 23:44:00, kalman wrote: > ...
5 years, 8 months ago (2015-04-01 23:53:12 UTC) #6
not at google - send to devlin
https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/1051563002/diff/40001/tools/json_schema_compiler/idl_schema.py#newcode416 tools/json_schema_compiler/idl_schema.py:416: self.properties[name] = prop On 2015/04/01 23:53:12, Devlin wrote: > ...
5 years, 8 months ago (2015-04-02 00:10:33 UTC) #7
Devlin
lgtm
5 years, 8 months ago (2015-04-02 00:16:29 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1051563002/80001
5 years, 8 months ago (2015-04-02 00:23:35 UTC) #10
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 8 months ago (2015-04-02 02:04:16 UTC) #11
commit-bot: I haz the power
5 years, 8 months ago (2015-04-03 20:21:23 UTC) #12
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d94f954f5e1c32e7be85e2ba835a143fd388a0d8
Cr-Commit-Position: refs/heads/master@{#323401}

Powered by Google App Engine
This is Rietveld 408576698