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

Issue 1635613002: [mojo-bindings] Support reuse of native enum classes (Closed)

Created:
4 years, 11 months ago by Ken Rockot(use gerrit already)
Modified:
4 years, 8 months ago
Reviewers:
yzshen1, xhwang, sky
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, rjkroege, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[mojo-bindings] Support reuse of native enum classes This CL supports the Native=True attribute on empty mojom enum declarations, allowing typemaps to establish the mojom enum name as an alias for some native enum class defined elsewhere. Optional custom validation is supported via specialization of mojo::EnumTraits<T>. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Patch Set 1 #

Patch Set 2 : remove now-unnecessary enum casts #

Total comments: 1

Patch Set 3 : add typemap_deps #

Patch Set 4 : no ostream operator for native enums #

Patch Set 5 : also convert ResourceFormat to native and fix public_deps #

Patch Set 6 : do not generate validators for native-only enums #

Total comments: 2

Patch Set 7 : fix more missing public_deps #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -108 lines) Patch
M cc/BUILD.gn View 1 2 3 4 5 6 2 chunks +1 line, -1 line 0 comments Download
M components/mus/BUILD.gn View 1 2 3 4 5 6 1 chunk +9 lines, -8 lines 0 comments Download
M components/mus/public/interfaces/BUILD.gn View 1 2 3 4 5 6 1 chunk +11 lines, -1 line 0 comments Download
A + components/mus/public/interfaces/cc.typemap View 1 2 3 4 5 6 1 chunk +3 lines, -6 lines 0 comments Download
M components/mus/public/interfaces/compositor_frame.mojom View 1 2 3 4 5 6 1 chunk +5 lines, -20 lines 0 comments Download
A + components/mus/public/interfaces/gpu.typemap View 1 2 3 4 5 6 1 chunk +3 lines, -6 lines 0 comments Download
M mandoline/ui/desktop_ui/BUILD.gn View 1 2 3 4 5 6 1 chunk +13 lines, -8 lines 0 comments Download
M mandoline/ui/desktop_ui/public/interfaces/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M mandoline/ui/omnibox/BUILD.gn View 1 2 3 4 1 chunk +7 lines, -4 lines 0 comments Download
M mash/wm/BUILD.gn View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
M mojo/converters/surfaces/surfaces_type_converters.cc View 1 2 3 4 5 6 6 chunks +4 lines, -9 lines 0 comments Download
A mojo/public/cpp/bindings/enum_traits.h View 1 2 3 4 5 6 1 chunk +56 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl View 1 2 3 4 5 6 3 chunks +23 lines, -13 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_definition.tmpl View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl View 1 2 3 4 5 6 4 chunks +7 lines, -4 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/mojom_cpp_generator.py View 1 2 3 4 5 6 9 chunks +31 lines, -19 lines 0 comments Download
M mojo/public/tools/bindings/mojom.gni View 1 2 3 4 5 6 2 chunks +7 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/generate/data.py View 1 2 3 4 5 6 2 chunks +10 lines, -1 line 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/parse/ast.py View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/parse/parser.py View 1 2 3 4 5 6 2 chunks +6 lines, -1 line 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/parse/translate.py View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 19 (8 generated)
Ken Rockot(use gerrit already)
Yuzhu, please take a look. I just realized you were going to look at enum ...
4 years, 11 months ago (2016-01-25 19:05:07 UTC) #2
sky
nice, LGTM
4 years, 11 months ago (2016-01-25 20:14:44 UTC) #3
yzshen1
Only a few nits. One question: As you can see in https://codereview.chromium.org/1618963006/ I changed the ...
4 years, 11 months ago (2016-01-26 04:36:30 UTC) #5
yzshen1
On 2016/01/26 04:36:30, yzshen1 wrote: > Only a few nits. > > One question: As ...
4 years, 11 months ago (2016-01-26 04:37:33 UTC) #6
Ken Rockot(use gerrit already)
I'll wait until you land your validation patch before rebasing this and fixing nits. On ...
4 years, 11 months ago (2016-01-26 15:41:21 UTC) #7
yzshen1
On Tue, Jan 26, 2016 at 7:41 AM, <rockot@chromium.org> wrote: > I'll wait until you ...
4 years, 11 months ago (2016-01-26 17:02:22 UTC) #8
Ken Rockot(use gerrit already)
On Tue, Jan 26, 2016 at 9:02 AM, Yuzhu Shen <yzshen@chromium.org> wrote: > > > ...
4 years, 11 months ago (2016-01-26 17:14:55 UTC) #9
yzshen1
On Tue, Jan 26, 2016 at 9:14 AM, Ken Rockot <rockot@chromium.org> wrote: > > On ...
4 years, 11 months ago (2016-01-26 17:55:58 UTC) #10
xhwang
Just realized that this CL is closed without being committed. Are we giving up on ...
4 years, 8 months ago (2016-03-29 05:04:40 UTC) #17
Ken Rockot(use gerrit already)
On 2016/03/29 at 05:04:40, xhwang wrote: > Just realized that this CL is closed without ...
4 years, 8 months ago (2016-03-29 05:10:05 UTC) #18
xhwang
4 years, 8 months ago (2016-03-29 05:38:02 UTC) #19
Message was sent while issue was closed.
On 2016/03/29 05:10:05, Ken Rockot wrote:
> On 2016/03/29 at 05:04:40, xhwang wrote:
> > Just realized that this CL is closed without being committed. Are we giving
up
> on the idea of reusing native enum classes?
> 
> I think I'd like to avoid it now, because it adds complexity without any clear
> benefit. I don't see any practical down side to moving enum definitions into
> mojom if they need to be used for IPC. It's trivial to define a non-mojom
alias
> for a mojom enum type if library developers want to hide the mojom detail from
> their users.

sgtm, thanks for the explanation! I can close
https://bugs.chromium.org/p/chromium/issues/detail?id=581405 now :)

Powered by Google App Engine
This is Rietveld 408576698