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

Issue 273323002: Convert snakecase enum names to camelcase when stringified. (Closed)

Created:
6 years, 7 months ago by David Tseng
Modified:
6 years, 7 months ago
CC:
chromium-reviews, aboxhall
Visibility:
Public.

Description

Convert snakecase enum names to camelcase when stringified. This cl adds a new attribute to the namespace node "camel_case_enum_to_string". This addresses the need for: - native enums to use snake case (e.g. LOAD_COMPLETE) - stringified values (used in js) to be camel cased (e.g. loadComplete). BUG=309681 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=270623

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : Address feedback #

Total comments: 4

Patch Set 4 : Address comments #

Patch Set 5 : Cap funciton names #

Total comments: 16

Patch Set 6 : Address feedback #

Total comments: 8

Patch Set 7 : Address reviewer comments. #

Patch Set 8 : Proposed cpp_enum_prefix_override attribute. #

Patch Set 9 : Cleanup #

Patch Set 10 : update tests #

Patch Set 11 : One rename missed. #

Total comments: 4

Patch Set 12 : final changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -112 lines) Patch
M chrome/renderer/resources/extensions/automation/automation_tree.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/resources/extensions/automation_custom_bindings.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/automation/tests/desktop/desktop.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/automation/tests/tabs/events.js View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/automation/tests/tabs/location.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/automation/tests/tabs/sanity_check.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -9 lines 0 comments Download
M tools/json_schema_compiler/cc_generator.py View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M tools/json_schema_compiler/cpp_type_generator.py View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M tools/json_schema_compiler/idl_schema.py View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +7 lines, -5 lines 0 comments Download
M tools/json_schema_compiler/model.py View 1 2 3 4 5 6 7 3 chunks +17 lines, -1 line 0 comments Download
M tools/json_schema_compiler/model_test.py View 1 2 3 4 5 6 1 chunk +15 lines, -0 lines 0 comments Download
M ui/accessibility/ax_enums.idl View 1 2 3 4 5 6 7 8 3 chunks +82 lines, -82 lines 0 comments Download
M ui/accessibility/ax_tree_unittest.cc View 1 2 3 4 5 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
David Tseng
Please have a look at the changes in the python scripts. I will rename the ...
6 years, 7 months ago (2014-05-13 17:10:00 UTC) #1
not at google - send to devlin
https://codereview.chromium.org/273323002/diff/20001/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://codereview.chromium.org/273323002/diff/20001/tools/json_schema_compiler/cc_generator.py#newcode896 tools/json_schema_compiler/cc_generator.py:896: name = re.sub("_\S", I don't know the re library ...
6 years, 7 months ago (2014-05-13 18:36:34 UTC) #2
David Tseng
PTAL. Still to start the rename in js but I assume the new compiler option ...
6 years, 7 months ago (2014-05-13 20:10:17 UTC) #3
not at google - send to devlin
thanks. https://codereview.chromium.org/273323002/diff/40001/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://codereview.chromium.org/273323002/diff/40001/tools/json_schema_compiler/cc_generator.py#newcode894 tools/json_schema_compiler/cc_generator.py:894: if 'camel_case_enum_to_string' in self._namespace.compiler_options: you might want to ...
6 years, 7 months ago (2014-05-13 20:18:22 UTC) #4
David Tseng
https://codereview.chromium.org/273323002/diff/40001/tools/json_schema_compiler/cc_generator.py File tools/json_schema_compiler/cc_generator.py (right): https://codereview.chromium.org/273323002/diff/40001/tools/json_schema_compiler/cc_generator.py#newcode894 tools/json_schema_compiler/cc_generator.py:894: if 'camel_case_enum_to_string' in self._namespace.compiler_options: On 2014/05/13 20:18:22, kalman wrote: ...
6 years, 7 months ago (2014-05-13 23:16:13 UTC) #5
not at google - send to devlin
final round I think.. sorry. https://codereview.chromium.org/273323002/diff/100001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/273323002/diff/100001/tools/json_schema_compiler/idl_schema.py#newcode440 tools/json_schema_compiler/idl_schema.py:440: compiler_options = {'implemented_in': node.value} ...
6 years, 7 months ago (2014-05-13 23:45:47 UTC) #6
David Tseng
https://codereview.chromium.org/273323002/diff/100001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/273323002/diff/100001/tools/json_schema_compiler/idl_schema.py#newcode440 tools/json_schema_compiler/idl_schema.py:440: compiler_options = {'implemented_in': node.value} On 2014/05/13 23:45:47, kalman wrote: ...
6 years, 7 months ago (2014-05-14 02:16:14 UTC) #7
not at google - send to devlin
lgtm https://codereview.chromium.org/273323002/diff/100001/tools/json_schema_compiler/model.py File tools/json_schema_compiler/model.py (right): https://codereview.chromium.org/273323002/diff/100001/tools/json_schema_compiler/model.py#newcode502 tools/json_schema_compiler/model.py:502: return ''.join(camel) On 2014/05/14 02:16:14, David Tseng wrote: ...
6 years, 7 months ago (2014-05-14 16:18:14 UTC) #8
David Tseng
PTAL I've uploaded two patchsets. The first addresses your comments; I've gone ahead and changed ...
6 years, 7 months ago (2014-05-14 18:11:30 UTC) #9
not at google - send to devlin
lgtm https://codereview.chromium.org/273323002/diff/220001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/273323002/diff/220001/tools/json_schema_compiler/idl_schema.py#newcode321 tools/json_schema_compiler/idl_schema.py:321: for property_name in ( should fit on 1 ...
6 years, 7 months ago (2014-05-14 23:43:42 UTC) #10
David Tseng
https://codereview.chromium.org/273323002/diff/220001/tools/json_schema_compiler/idl_schema.py File tools/json_schema_compiler/idl_schema.py (right): https://codereview.chromium.org/273323002/diff/220001/tools/json_schema_compiler/idl_schema.py#newcode321 tools/json_schema_compiler/idl_schema.py:321: for property_name in ( On 2014/05/14 23:43:43, kalman wrote: ...
6 years, 7 months ago (2014-05-15 01:12:36 UTC) #11
David Tseng
The CQ bit was checked by dtseng@chromium.org
6 years, 7 months ago (2014-05-15 01:12:58 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/273323002/240001
6 years, 7 months ago (2014-05-15 01:14:53 UTC) #13
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-15 03:14:46 UTC) #14
commit-bot: I haz the power
6 years, 7 months ago (2014-05-15 08:04:04 UTC) #15
Message was sent while issue was closed.
Change committed as 270623

Powered by Google App Engine
This is Rietveld 408576698