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

Issue 1488773003: Add js_interface_generator for generating extensions interfaces (Closed)

Created:
5 years ago by stevenjb
Modified:
5 years ago
Reviewers:
Devlin, Dan Beam, michaelpg
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add js_interface_generator for generating extensions interfaces BUG=563744 Committed: https://crrev.com/f0e8cce5133fa2fe35eff3e107acd455c86f95fe Cr-Commit-Position: refs/heads/master@{#364423}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Move common functions to js_util.py #

Patch Set 3 : similarity=25 #

Total comments: 7

Patch Set 4 : Move COPYRIGHT / INFO -> js_util.py #

Patch Set 5 : . #

Total comments: 22

Patch Set 6 : Feedback #

Total comments: 6

Patch Set 7 : Embed entire expected output text except year and exe name #

Patch Set 8 : Rebase + shorten line #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+350 lines, -382 lines) Patch
M tools/json_schema_compiler/code.py View 1 2 3 4 5 2 chunks +13 lines, -2 lines 2 comments Download
M tools/json_schema_compiler/compiler.py View 1 2 3 4 5 4 chunks +13 lines, -2 lines 0 comments Download
M tools/json_schema_compiler/js_externs_generator.py View 1 2 3 4 5 6 9 chunks +27 lines, -153 lines 0 comments Download
M tools/json_schema_compiler/js_externs_generator_test.py View 1 2 3 4 5 6 5 chunks +25 lines, -19 lines 2 comments Download
A tools/json_schema_compiler/js_interface_generator.py View 1 2 3 4 5 6 1 chunk +102 lines, -0 lines 0 comments Download
A tools/json_schema_compiler/js_interface_generator_test.py View 1 2 3 4 5 6 7 1 chunk +133 lines, -0 lines 0 comments Download
A + tools/json_schema_compiler/js_util.py View 1 2 3 5 chunks +37 lines, -206 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 43 (15 generated)
stevenjb
5 years ago (2015-12-01 01:34:04 UTC) #2
Devlin
https://codereview.chromium.org/1488773003/diff/1/tools/json_schema_compiler/js_interface_generator.py File tools/json_schema_compiler/js_interface_generator.py (right): https://codereview.chromium.org/1488773003/diff/1/tools/json_schema_compiler/js_interface_generator.py#newcode1 tools/json_schema_compiler/js_interface_generator.py:1: # Copyright 2015 The Chromium Authors. All rights reserved. ...
5 years ago (2015-12-02 17:58:28 UTC) #3
stevenjb
https://codereview.chromium.org/1488773003/diff/1/tools/json_schema_compiler/js_interface_generator.py File tools/json_schema_compiler/js_interface_generator.py (right): https://codereview.chromium.org/1488773003/diff/1/tools/json_schema_compiler/js_interface_generator.py#newcode1 tools/json_schema_compiler/js_interface_generator.py:1: # Copyright 2015 The Chromium Authors. All rights reserved. ...
5 years ago (2015-12-02 18:07:40 UTC) #4
michaelpg
There is definitely more than enough copied code to warrant extracting out a helper class. ...
5 years ago (2015-12-02 19:39:45 UTC) #5
stevenjb
Separated out the common code and decreased the similarity for better diffs. PTAL https://codereview.chromium.org/1488773003/diff/1/tools/json_schema_compiler/js_interface_generator.py File ...
5 years ago (2015-12-02 20:30:07 UTC) #9
Devlin
https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py File tools/json_schema_compiler/js_interface_generator.py (right): https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py#newcode19 tools/json_schema_compiler/js_interface_generator.py:19: LICENSE = ("""// Copyright %s The Chromium Authors. All ...
5 years ago (2015-12-04 17:44:23 UTC) #10
stevenjb
https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py File tools/json_schema_compiler/js_interface_generator.py (right): https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py#newcode19 tools/json_schema_compiler/js_interface_generator.py:19: LICENSE = ("""// Copyright %s The Chromium Authors. All ...
5 years ago (2015-12-04 18:24:08 UTC) #11
Devlin
https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py File tools/json_schema_compiler/js_interface_generator.py (right): https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py#newcode65 tools/json_schema_compiler/js_interface_generator.py:65: On 2015/12/04 18:24:07, stevenjb wrote: > On 2015/12/04 17:44:23, ...
5 years ago (2015-12-04 18:28:59 UTC) #12
stevenjb
On 2015/12/04 18:28:59, Devlin wrote: > https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py > File tools/json_schema_compiler/js_interface_generator.py (right): > > https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py#newcode65 > ...
5 years ago (2015-12-04 18:48:25 UTC) #13
Devlin
On 2015/12/04 18:48:25, stevenjb wrote: > On 2015/12/04 18:28:59, Devlin wrote: > > > https://codereview.chromium.org/1488773003/diff/100001/tools/json_schema_compiler/js_interface_generator.py ...
5 years ago (2015-12-04 19:35:27 UTC) #14
stevenjb
Right. Well, it's related to that, and a good copy/paste starting point, but it turns ...
5 years ago (2015-12-04 19:53:09 UTC) #15
michaelpg
https://codereview.chromium.org/1488773003/diff/140001/tools/json_schema_compiler/code.py File tools/json_schema_compiler/code.py (right): https://codereview.chromium.org/1488773003/diff/140001/tools/json_schema_compiler/code.py#newcode34 tools/json_schema_compiler/code.py:34: self._line_prefixes) 4-space indent https://codereview.chromium.org/1488773003/diff/140001/tools/json_schema_compiler/code.py#newcode177 tools/json_schema_compiler/code.py:177: """Trims any trailing newlines ...
5 years ago (2015-12-04 21:02:19 UTC) #16
stevenjb
PTAL https://codereview.chromium.org/1488773003/diff/140001/tools/json_schema_compiler/code.py File tools/json_schema_compiler/code.py (right): https://codereview.chromium.org/1488773003/diff/140001/tools/json_schema_compiler/code.py#newcode34 tools/json_schema_compiler/code.py:34: self._line_prefixes) On 2015/12/04 21:02:19, michaelpg wrote: > 4-space ...
5 years ago (2015-12-07 18:31:24 UTC) #17
michaelpg
Ok, I think this LGTM assuming the generated interfaces are working. Caveat: my python-fu is ...
5 years ago (2015-12-07 18:46:53 UTC) #18
Devlin
lgtm https://codereview.chromium.org/1488773003/diff/160001/tools/json_schema_compiler/js_externs_generator.py File tools/json_schema_compiler/js_externs_generator.py (right): https://codereview.chromium.org/1488773003/diff/160001/tools/json_schema_compiler/js_externs_generator.py#newcode38 tools/json_schema_compiler/js_externs_generator.py:38: GetHeader = staticmethod(GetHeader) yuck. See other comment. https://codereview.chromium.org/1488773003/diff/160001/tools/json_schema_compiler/js_externs_generator_test.py ...
5 years ago (2015-12-07 18:55:28 UTC) #19
stevenjb
PTAL https://codereview.chromium.org/1488773003/diff/140001/tools/json_schema_compiler/compiler.py File tools/json_schema_compiler/compiler.py (right): https://codereview.chromium.org/1488773003/diff/140001/tools/json_schema_compiler/compiler.py#newcode150 tools/json_schema_compiler/compiler.py:150: output_code += [filename, '', code, ''] On 2015/12/07 ...
5 years ago (2015-12-07 19:49:32 UTC) #20
Devlin
slgtm
5 years ago (2015-12-07 22:10:55 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1488773003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1488773003/180001
5 years ago (2015-12-07 22:18:17 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/126099)
5 years ago (2015-12-07 23:58:40 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1488773003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1488773003/180001
5 years ago (2015-12-08 22:17:01 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/126684)
5 years ago (2015-12-08 22:31:56 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1488773003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1488773003/180001
5 years ago (2015-12-09 17:43:07 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/127089)
5 years ago (2015-12-09 17:56:24 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1488773003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1488773003/200001
5 years ago (2015-12-10 16:44:49 UTC) #37
commit-bot: I haz the power
Committed patchset #8 (id:200001)
5 years ago (2015-12-10 19:27:46 UTC) #38
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/f0e8cce5133fa2fe35eff3e107acd455c86f95fe Cr-Commit-Position: refs/heads/master@{#364423}
5 years ago (2015-12-10 19:28:34 UTC) #40
Dan Beam
sweet! https://codereview.chromium.org/1488773003/diff/200001/tools/json_schema_compiler/code.py File tools/json_schema_compiler/code.py (right): https://codereview.chromium.org/1488773003/diff/200001/tools/json_schema_compiler/code.py#newcode177 tools/json_schema_compiler/code.py:177: """Trims any trailing newlines. i'm confused by this ...
5 years ago (2015-12-10 22:17:33 UTC) #42
stevenjb
5 years ago (2015-12-10 22:29:05 UTC) #43
Message was sent while issue was closed.
https://codereview.chromium.org/1488773003/diff/200001/tools/json_schema_comp...
File tools/json_schema_compiler/code.py (right):

https://codereview.chromium.org/1488773003/diff/200001/tools/json_schema_comp...
tools/json_schema_compiler/code.py:177: """Trims any trailing newlines.
On 2015/12/10 22:17:33, Dan Beam wrote:
> i'm confused by this code, but have you seen rstrip()?

self._code is an array of Line objects. This removes empty Line objects at the
end. The comment could be better.

https://codereview.chromium.org/1488773003/diff/200001/tools/json_schema_comp...
File tools/json_schema_compiler/js_externs_generator_test.py (right):

https://codereview.chromium.org/1488773003/diff/200001/tools/json_schema_comp...
tools/json_schema_compiler/js_externs_generator_test.py:282:
(datetime.now().year, sys.argv[0]))
On 2015/12/10 22:17:33, Dan Beam wrote:
> not sure i understand this indent

Hmm, me neither. I blame my editor. If (when) we need to update this I will fix
it, or in a separate followup.

Powered by Google App Engine
This is Rietveld 408576698