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

Issue 1375313006: For c++, Generate enum classes instead of enum from mojom. (Closed)

Created:
5 years, 2 months ago by johngro
Modified:
5 years, 2 months ago
Reviewers:
vtl, viettrungluu
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, rudominer
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

For c++, Generate enum classes instead of enum from mojom. Change the mojom c++ binding generator to produce C++11 style enum classes instead of just enums. Fixup generated code to be compatible with this new (stricter) syntax. Also, fixup existing code to be compatible with the new syntax requirements BUG= R=viettrungluu@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/87fe514b87c52e09c4c3ffc406c8afb8c068a3f4

Patch Set 1 #

Total comments: 18

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1105 lines, -1048 lines) Patch
M apps/moterm/gl_helper.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M apps/moterm/gl_helper_test_app.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M apps/moterm/key_util.h View 1 chunk +1 line, -1 line 0 comments Download
M apps/moterm/key_util.cc View 3 chunks +169 lines, -169 lines 0 comments Download
M apps/moterm/key_util_unittest.cc View 2 chunks +17 lines, -17 lines 0 comments Download
M apps/moterm/moterm_driver.cc View 1 12 chunks +43 lines, -43 lines 0 comments Download
M apps/moterm/moterm_driver_unittest.cc View 3 chunks +14 lines, -14 lines 0 comments Download
M apps/moterm/moterm_view.cc View 5 chunks +7 lines, -7 lines 0 comments Download
M examples/bitmap_uploader/bitmap_uploader.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M examples/browser/browser.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/echo_terminal/main.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M examples/embedded_app/embedded_app.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M examples/ganesh_app/texture_uploader.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M examples/http_handler/http_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/keyboard_client/keyboard_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/moterm_example_app/moterm_example_app.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M examples/native_run_app/native_run_app.cc View 1 6 chunks +8 lines, -8 lines 0 comments Download
M examples/nesting_app/nesting_app.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/nfc_sender/nfc_sender.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M examples/pdf_viewer/pdf_viewer.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M examples/spinning_cube/gles2_client_impl.cc View 3 chunks +7 lines, -7 lines 0 comments Download
M examples/window_manager/window_manager.cc View 5 chunks +9 lines, -9 lines 0 comments Download
M examples/wm_flow/app/app.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M examples/wm_flow/wm/wm.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/converters/input_events/input_events_type_converters.cc View 10 chunks +43 lines, -43 lines 0 comments Download
M mojo/converters/surfaces/surfaces_type_converters.cc View 8 chunks +11 lines, -11 lines 0 comments Download
M mojo/converters/surfaces/tests/surface_unittest.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M mojo/gpu/texture_uploader.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/tests/binding_unittest.cc View 7 chunks +7 lines, -7 lines 0 comments Download
M mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M mojo/public/cpp/bindings/tests/request_response_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/tests/sample_service_unittest.cc View 5 chunks +9 lines, -9 lines 0 comments Download
M mojo/public/cpp/bindings/tests/union_unittest.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M mojo/public/cpp/bindings/tests/versioning_apptest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/tests/versioning_test_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl View 1 2 chunks +25 lines, -3 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl View 1 chunk +6 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl View 1 2 chunks +3 lines, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl View 1 2 chunks +3 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl View 1 2 chunks +3 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl View 1 1 chunk +3 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl View 1 2 chunks +4 lines, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl View 1 chunk +6 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl View 1 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/mojom_cpp_generator.py View 1 3 chunks +23 lines, -5 lines 0 comments Download
M mojo/services/files/public/c/lib/directory_wrapper.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/services/files/public/c/lib/file_fd_impl.cc View 8 chunks +16 lines, -15 lines 0 comments Download
M mojo/services/files/public/c/lib/util.h View 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/files/public/c/lib/util.cc View 1 chunk +9 lines, -9 lines 0 comments Download
M mojo/services/files/public/c/tests/mojio_impl_test_base.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/services/files/public/c/tests/test_utils.cc View 5 chunks +12 lines, -12 lines 0 comments Download
M mojo/services/files/public/c/tests/util_unittest.cc View 1 chunk +9 lines, -9 lines 0 comments Download
M mojo/services/files/public/cpp/lib/input_stream_file.cc View 11 chunks +34 lines, -34 lines 0 comments Download
M mojo/services/files/public/cpp/lib/output_stream_file.cc View 7 chunks +31 lines, -31 lines 0 comments Download
M mojo/services/files/public/cpp/tests/input_stream_file_unittest.cc View 11 chunks +26 lines, -26 lines 0 comments Download
M mojo/services/files/public/cpp/tests/output_stream_file_unittest.cc View 3 chunks +5 lines, -5 lines 0 comments Download
M mojo/services/surfaces/public/cpp/surfaces_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/view_manager/public/cpp/lib/view.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/view_manager/public/cpp/tests/view_unittest.cc View 6 chunks +10 lines, -10 lines 0 comments Download
M services/clipboard/clipboard_apptest.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M services/debugger/debugger.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/device_info/device_info.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M services/files/directory_impl.cc View 13 chunks +35 lines, -35 lines 0 comments Download
M services/files/directory_impl_unittest.cc View 6 chunks +35 lines, -35 lines 0 comments Download
M services/files/file_impl.cc View 12 chunks +44 lines, -44 lines 0 comments Download
M services/files/file_impl_unittest.cc View 20 chunks +139 lines, -139 lines 0 comments Download
M services/files/files_impl.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M services/files/files_test_base.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M services/files/shared_impl.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M services/files/util.h View 1 chunk +5 lines, -5 lines 0 comments Download
M services/files/util.cc View 3 chunks +21 lines, -21 lines 0 comments Download
M services/http_server/http_server_apptest.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/http_server/http_server_factory_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M services/keyboard_native/view_observer_delegate.cc View 3 chunks +7 lines, -7 lines 0 comments Download
M services/native_support/process_controller_impl.cc View 1 4 chunks +10 lines, -10 lines 0 comments Download
M services/native_support/process_controller_impl_unittest.cc View 1 6 chunks +12 lines, -12 lines 0 comments Download
M services/native_support/process_impl.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M services/native_support/process_impl_unittest.cc View 1 2 chunks +12 lines, -12 lines 0 comments Download
M services/native_support/redirectors.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M services/native_viewport/native_viewport_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M services/native_viewport/platform_viewport_android.cc View 1 2 3 chunks +6 lines, -6 lines 0 comments Download
M services/python/mojo_url_redirector/mojo_url_redirector_apptest.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/view_manager/animation_runner_unittest.cc View 1 2 4 chunks +4 lines, -8 lines 0 comments Download
M services/view_manager/connection_manager.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M services/view_manager/display_manager.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M services/view_manager/gesture_manager.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M services/view_manager/gesture_manager_unittest.cc View 15 chunks +22 lines, -22 lines 0 comments Download
M services/view_manager/scheduled_animation_group.cc View 1 10 chunks +21 lines, -24 lines 0 comments Download
M services/view_manager/scheduled_animation_group_unittest.cc View 4 chunks +8 lines, -10 lines 0 comments Download
M services/view_manager/server_view.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M services/view_manager/test_change_tracker.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M services/view_manager/view_manager_service_apptest.cc View 1 8 chunks +14 lines, -17 lines 0 comments Download
M services/view_manager/view_manager_service_impl.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M services/view_manager/view_manager_service_unittest.cc View 5 chunks +9 lines, -9 lines 0 comments Download
M shell/application_manager/network_fetcher.cc View 1 chunk +1 line, -1 line 0 comments Download
M shell/shell_apptest.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 11 (2 generated)
viettrungluu
https://codereview.chromium.org/1375313006/diff/1/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl File mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl (right): https://codereview.chromium.org/1375313006/diff/1/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl#newcode50 mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl:50: static inline std::ostream& operator<<( You need to include appropriate ...
5 years, 2 months ago (2015-10-01 17:49:56 UTC) #3
johngro
top level comment Since you seem to want to review both the tool changes as ...
5 years, 2 months ago (2015-10-02 00:49:04 UTC) #4
viettrungluu
On 2015/10/02 00:49:04, johngro wrote: > top level comment > > Since you seem to ...
5 years, 2 months ago (2015-10-02 01:15:11 UTC) #5
viettrungluu
(I looked at the diff, and there were only these cases of "using".) https://codereview.chromium.org/1375313006/diff/20001/services/view_manager/animation_runner_unittest.cc File ...
5 years, 2 months ago (2015-10-02 01:19:28 UTC) #6
viettrungluu
/cc rudominer Apparently, you also have to update services/native_viewport/platform_viewport_android.cc (and maybe some other Android-specific files) ...
5 years, 2 months ago (2015-10-02 01:24:44 UTC) #7
johngro
https://codereview.chromium.org/1375313006/diff/20001/services/view_manager/animation_runner_unittest.cc File services/view_manager/animation_runner_unittest.cc (right): https://codereview.chromium.org/1375313006/diff/20001/services/view_manager/animation_runner_unittest.cc#newcode17 services/view_manager/animation_runner_unittest.cc:17: using mojo::AnimationProperty::NONE; On 2015/10/02 01:19:28, viettrungluu wrote: > Delete ...
5 years, 2 months ago (2015-10-02 16:13:41 UTC) #8
johngro
> Let's make a reasonable decision. I propose: > * If the RHS is typed ...
5 years, 2 months ago (2015-10-02 16:44:48 UTC) #9
johngro
On 2015/10/02 01:24:44, viettrungluu wrote: > If it isn't too onerous to remove the need ...
5 years, 2 months ago (2015-10-02 17:11:25 UTC) #10
johngro
5 years, 2 months ago (2015-10-02 17:12:16 UTC) #11
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
87fe514b87c52e09c4c3ffc406c8afb8c068a3f4.

Powered by Google App Engine
This is Rietveld 408576698