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

Issue 164873002: Fix bug with using enums as default values in mojom. We were previously (Closed)

Created:
6 years, 10 months ago by Matt Perry
Modified:
6 years, 10 months ago
CC:
chromium-reviews, viettrungluu+watch_chromium.org, tfarina, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Visibility:
Public.

Description

Fix bug with using enums as default values in mojom. We were previously generating invalid JavaScript bindings. We now translate an enum value like FOO_VALUE in a mojom file to proper_namespace.EnumName.FOO_VALUE in JS. I also fixed enum declarations in JS so an enum value can be defined in terms of itself, e.g. enum Foo { FOO_1, FOO_2 = FOO_1 * 2 }; BUG=320082 R=darin@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251417

Patch Set 1 #

Total comments: 2

Patch Set 2 : rebase #

Patch Set 3 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -47 lines) Patch
M mojo/apps/js/bindings/sample_service_unittests.js View 2 chunks +5 lines, -6 lines 0 comments Download
M mojo/public/bindings/generators/cpp_templates/enum_declaration.tmpl View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/bindings/generators/cpp_templates/struct_builder_definition.tmpl View 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/bindings/generators/js_templates/enum_definition.tmpl View 1 chunk +9 lines, -7 lines 0 comments Download
M mojo/public/bindings/generators/js_templates/interface_definition.tmpl View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/public/bindings/generators/js_templates/module.js.tmpl View 1 chunk +3 lines, -3 lines 0 comments Download
M mojo/public/bindings/generators/js_templates/struct_definition.tmpl View 2 chunks +3 lines, -2 lines 0 comments Download
M mojo/public/bindings/generators/mojom_cpp_generator.py View 3 chunks +13 lines, -6 lines 0 comments Download
M mojo/public/bindings/generators/mojom_js_generator.py View 4 chunks +52 lines, -6 lines 0 comments Download
M mojo/public/bindings/mojom_bindings_generator.gypi View 2 chunks +2 lines, -0 lines 0 comments Download
M mojo/public/bindings/pylib/generate/mojom_data.py View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/public/bindings/pylib/generate/mojom_generator.py View 1 chunk +8 lines, -0 lines 0 comments Download
M mojo/public/bindings/pylib/parse/mojo_parser.py View 6 chunks +11 lines, -7 lines 0 comments Download
M mojo/public/bindings/tests/sample_import2.mojom View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/public/bindings/tests/sample_service.mojom View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/bindings/tests/sample_service_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Matt Perry
6 years, 10 months ago (2014-02-13 21:59:33 UTC) #1
darin (slow to review)
LGTM https://codereview.chromium.org/164873002/diff/1/mojo/apps/js/bindings/sample_service_unittests.js File mojo/apps/js/bindings/sample_service_unittests.js (right): https://codereview.chromium.org/164873002/diff/1/mojo/apps/js/bindings/sample_service_unittests.js#newcode124 mojo/apps/js/bindings/sample_service_unittests.js:124: expect(full.thing.color).toBe(imported2.Color.COLOR_BLACK); Note: it seems like it would be ...
6 years, 10 months ago (2014-02-13 22:55:21 UTC) #2
Matt Perry
The CQ bit was checked by mpcomplete@chromium.org
6 years, 10 months ago (2014-02-14 02:01:06 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpcomplete@chromium.org/164873002/220001
6 years, 10 months ago (2014-02-14 02:03:29 UTC) #4
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-14 03:20:20 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel
6 years, 10 months ago (2014-02-14 03:20:21 UTC) #6
Matt Perry
https://codereview.chromium.org/164873002/diff/1/mojo/apps/js/bindings/sample_service_unittests.js File mojo/apps/js/bindings/sample_service_unittests.js (right): https://codereview.chromium.org/164873002/diff/1/mojo/apps/js/bindings/sample_service_unittests.js#newcode124 mojo/apps/js/bindings/sample_service_unittests.js:124: expect(full.thing.color).toBe(imported2.Color.COLOR_BLACK); On 2014/02/13 22:55:21, darin wrote: > Note: it ...
6 years, 10 months ago (2014-02-14 19:43:42 UTC) #7
Matt Perry
The CQ bit was checked by mpcomplete@chromium.org
6 years, 10 months ago (2014-02-14 19:45:08 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpcomplete@chromium.org/164873002/440001
6 years, 10 months ago (2014-02-14 19:45:29 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-14 20:34:18 UTC) #10
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=202422
6 years, 10 months ago (2014-02-14 20:34:18 UTC) #11
Matt Perry
6 years, 10 months ago (2014-02-14 21:08:40 UTC) #12
Message was sent while issue was closed.
Committed patchset #3 manually as r251417 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698