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

Issue 1832703002: Mojo: Simplify typemap usage. (Closed)

Created:
4 years, 9 months ago by Sam McNally
Modified:
4 years, 8 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@mojo-bindings-variant-import
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mojo: Simplify typemap usage. Previously, to use native types in mojo interfaces, the correct typemaps needed to be set on each target depending on the mojom target containing that interface. Additionally, each variant required a duplicate set of mojom targets for all the mojom files required by that variant. This CL changes the mojom GN template to generate a mojom target for each variant, applying the appropriate typemaps when generating the bindings. This is controlled by mojo bindings configurations that aggregate all of the typemaps for that configuration and specify the variant for that configuration. To accommodate this change, this also changes the typemap format to be one GN-format file per mojom file, setting variables that specify the typemap. At build time, the typemap information and any dependencies are used to generate a JSON typemap of the old JSON format containing all typemaps for the bindings being generated as well as their dependencies. This makes minor changes to typemap support in GYP. With this CL, typemaps can be specified as GYP variables instead of directly specifying them in extra generator command line arguments. CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel BUG=596202 Committed: https://crrev.com/b54ee6567f200280a284fc466706962fa810e398 Cr-Commit-Position: refs/heads/master@{#388164}

Patch Set 1 : #

Total comments: 18

Patch Set 2 : rebase #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 21

Patch Set 6 : #

Patch Set 7 : rebase #

Total comments: 2

Patch Set 8 : rebase #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : rebase #

Patch Set 12 : add missing mash dependency #

Unified diffs Side-by-side diffs Delta from patch set Stats (+927 lines, -665 lines) Patch
M components/mus/public/interfaces/BUILD.gn View 1 chunk +0 lines, -3 lines 0 comments Download
M components/password_manager.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -3 lines 0 comments Download
M components/password_manager/content/public/interfaces/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -2 lines 0 comments Download
M content/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -2 lines 0 comments Download
M content/content_common_mojo_bindings.gyp View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M gpu/command_buffer/common/BUILD.gn View 1 2 3 4 5 6 1 chunk +0 lines, -3 lines 0 comments Download
A gpu/command_buffer/common/capabilities.typemap View 1 chunk +12 lines, -0 lines 0 comments Download
A gpu/command_buffer/common/command_buffer.typemap View 1 chunk +12 lines, -0 lines 0 comments Download
A gpu/command_buffer/common/mailbox.typemap View 1 chunk +12 lines, -0 lines 0 comments Download
A gpu/command_buffer/common/mailbox_holder.typemap View 1 chunk +12 lines, -0 lines 0 comments Download
D gpu/command_buffer/common/mojo.typemap View 1 chunk +0 lines, -62 lines 0 comments Download
A gpu/command_buffer/common/sync_token.typemap View 1 chunk +12 lines, -0 lines 0 comments Download
A gpu/command_buffer/common/typemaps.gni View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
A gpu/command_buffer/common/value_state.typemap View 1 chunk +12 lines, -0 lines 0 comments Download
M gpu/ipc/common/BUILD.gn View 1 2 3 4 5 6 7 2 chunks +9 lines, -3 lines 0 comments Download
M mash/wm/public/interfaces/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M mojo/android/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/mojo_edk_tests.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -2 lines 0 comments Download
M mojo/mojo_public.gyp View 1 2 3 4 5 6 7 8 9 10 8 chunks +25 lines, -51 lines 0 comments Download
M mojo/mojom_bindings_generator.gypi View 1 2 3 4 5 5 chunks +22 lines, -14 lines 0 comments Download
M mojo/mojom_bindings_generator_explicit.gypi View 1 2 3 4 5 6 4 chunks +21 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -1 line 0 comments Download
M mojo/public/cpp/bindings/tests/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 4 chunks +13 lines, -16 lines 0 comments Download
A mojo/public/cpp/bindings/tests/blink_typemaps.gni View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/tests/chromium_typemaps.gni View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/pickle_unittest.cc View 7 chunks +27 lines, -29 lines 0 comments Download
A mojo/public/cpp/bindings/tests/rect_blink.typemap View 1 chunk +9 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/rect_blink_traits.h View 1 chunk +3 lines, -4 lines 0 comments Download
A mojo/public/cpp/bindings/tests/rect_chromium.typemap View 1 chunk +9 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/rect_chromium_traits.h View 1 chunk +3 lines, -4 lines 0 comments Download
M mojo/public/cpp/bindings/tests/struct_traits_unittest.cc View 9 chunks +18 lines, -18 lines 0 comments Download
A mojo/public/cpp/bindings/tests/struct_with_traits.typemap View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/struct_with_traits_impl.h View 1 2 1 chunk +0 lines, -6 lines 0 comments Download
M mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/tests/test_native_types_blink.typemap View 1 chunk +11 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap View 1 chunk +15 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/wtf_types_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M mojo/public/interfaces/bindings/tests/BUILD.gn View 1 2 3 4 5 4 chunks +56 lines, -58 lines 0 comments Download
D mojo/public/interfaces/bindings/tests/blink_test.typemap View 1 chunk +0 lines, -23 lines 0 comments Download
D mojo/public/interfaces/bindings/tests/chromium_test.typemap View 1 chunk +0 lines, -23 lines 0 comments Download
D mojo/public/interfaces/bindings/tests/struct_with_traits.typemap View 1 chunk +0 lines, -17 lines 0 comments Download
D mojo/public/interfaces/bindings/tests/test_variant.mojom View 1 2 1 chunk +0 lines, -17 lines 0 comments Download
D mojo/public/interfaces/bindings/tests/test_variant_import.mojom View 1 2 1 chunk +0 lines, -7 lines 0 comments Download
A mojo/public/tools/bindings/blink_bindings_configuration.gni View 1 2 3 4 5 6 7 8 9 1 chunk +33 lines, -0 lines 0 comments Download
A mojo/public/tools/bindings/chromium_bindings_configuration.gni View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
A mojo/public/tools/bindings/format_typemap_generator_args.py View 1 chunk +34 lines, -0 lines 0 comments Download
A mojo/public/tools/bindings/generate_type_mappings.py View 1 2 3 4 5 1 chunk +123 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/mojom.gni View 1 3 chunks +278 lines, -191 lines 0 comments Download
M mojo/public/tools/bindings/mojom_get_generator_typemap_args.py View 1 chunk +0 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/modules/BUILD.gn View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -23 lines 0 comments Download
M third_party/WebKit/public/blink.gyp View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M url/mojo/BUILD.gn View 3 chunks +0 lines, -9 lines 0 comments Download
M url/mojo/gurl.typemap View 1 chunk +10 lines, -16 lines 0 comments Download
M url/mojo/origin.typemap View 1 chunk +10 lines, -16 lines 0 comments Download
A url/mojo/typemaps.gni View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M url/url.gyp View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -9 lines 0 comments Download

Messages

Total messages: 59 (37 generated)
Sam McNally
4 years, 8 months ago (2016-04-04 10:06:36 UTC) #27
yzshen1
First part of comments... (haven't reviewed py files.) Thanks! https://codereview.chromium.org/1832703002/diff/380001/gpu/command_buffer/common/capabilities.typemap File gpu/command_buffer/common/capabilities.typemap (right): https://codereview.chromium.org/1832703002/diff/380001/gpu/command_buffer/common/capabilities.typemap#newcode12 gpu/command_buffer/common/capabilities.typemap:12: ...
4 years, 8 months ago (2016-04-05 17:36:14 UTC) #28
Sam McNally
https://codereview.chromium.org/1832703002/diff/380001/gpu/command_buffer/common/capabilities.typemap File gpu/command_buffer/common/capabilities.typemap (right): https://codereview.chromium.org/1832703002/diff/380001/gpu/command_buffer/common/capabilities.typemap#newcode12 gpu/command_buffer/common/capabilities.typemap:12: type_mappings = [ "gpu.mojom.Capabilities=gpu::Capabilities" ] On 2016/04/05 17:36:14, yzshen1 ...
4 years, 8 months ago (2016-04-06 07:02:53 UTC) #30
yzshen1
https://codereview.chromium.org/1832703002/diff/380001/gpu/command_buffer/common/capabilities.typemap File gpu/command_buffer/common/capabilities.typemap (right): https://codereview.chromium.org/1832703002/diff/380001/gpu/command_buffer/common/capabilities.typemap#newcode12 gpu/command_buffer/common/capabilities.typemap:12: type_mappings = [ "gpu.mojom.Capabilities=gpu::Capabilities" ] On 2016/04/06 07:02:53, Sam ...
4 years, 8 months ago (2016-04-06 16:00:47 UTC) #31
Sam McNally
https://codereview.chromium.org/1832703002/diff/380001/mojo/public/cpp/bindings/tests/struct_with_traits.typemap File mojo/public/cpp/bindings/tests/struct_with_traits.typemap (right): https://codereview.chromium.org/1832703002/diff/380001/mojo/public/cpp/bindings/tests/struct_with_traits.typemap#newcode11 mojo/public/cpp/bindings/tests/struct_with_traits.typemap:11: "//mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc", On 2016/04/06 16:00:47, yzshen1 wrote: > On 2016/04/06 ...
4 years, 8 months ago (2016-04-07 00:19:43 UTC) #33
yzshen1
The change mostly looks good. Thanks! Have you verified the following behavior, for both GYP ...
4 years, 8 months ago (2016-04-08 19:58:25 UTC) #34
Sam McNally
On 2016/04/08 19:58:25, yzshen1 wrote: > The change mostly looks good. Thanks! > > Have ...
4 years, 8 months ago (2016-04-11 04:40:27 UTC) #36
yzshen1
LGTM with a couple of nits. Thanks! https://codereview.chromium.org/1832703002/diff/520001/gpu/command_buffer/common/typemaps.gni File gpu/command_buffer/common/typemaps.gni (right): https://codereview.chromium.org/1832703002/diff/520001/gpu/command_buffer/common/typemaps.gni#newcode6 gpu/command_buffer/common/typemaps.gni:6: "//gpu/command_buffer/common/capabilities.typemap", On ...
4 years, 8 months ago (2016-04-11 16:02:56 UTC) #37
Sam McNally
+esprehn and haraken for blink changes +dcheng for gpu/ipc/common/BUILD.gn +brettw for GN use in mojo/public/tools/bindings/mojom.gni ...
4 years, 8 months ago (2016-04-12 07:54:32 UTC) #39
Ken Rockot(use gerrit already)
lgtm
4 years, 8 months ago (2016-04-12 15:16:25 UTC) #40
jam
lgtm
4 years, 8 months ago (2016-04-12 15:28:23 UTC) #41
dcheng
4 years, 8 months ago (2016-04-13 00:51:33 UTC) #42
dcheng
lgtm
4 years, 8 months ago (2016-04-13 00:51:40 UTC) #43
ortuno
https://codereview.chromium.org/1832703002/diff/580001/third_party/WebKit/public/BUILD.gn File third_party/WebKit/public/BUILD.gn (left): https://codereview.chromium.org/1832703002/diff/580001/third_party/WebKit/public/BUILD.gn#oldcode177 third_party/WebKit/public/BUILD.gn:177: # GYP version: WebKit/public/blink.gyp:mojo_bindings_blink_mojom Do we still the target ...
4 years, 8 months ago (2016-04-13 15:35:44 UTC) #44
Sam McNally
https://codereview.chromium.org/1832703002/diff/580001/third_party/WebKit/public/BUILD.gn File third_party/WebKit/public/BUILD.gn (left): https://codereview.chromium.org/1832703002/diff/580001/third_party/WebKit/public/BUILD.gn#oldcode177 third_party/WebKit/public/BUILD.gn:177: # GYP version: WebKit/public/blink.gyp:mojo_bindings_blink_mojom On 2016/04/13 15:35:44, ortuno wrote: ...
4 years, 8 months ago (2016-04-14 03:27:43 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1832703002/700001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1832703002/700001
4 years, 8 months ago (2016-04-19 06:54:38 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: win_optional_gpu_tests_rel on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_optional_gpu_tests_rel/builds/880)
4 years, 8 months ago (2016-04-19 06:56:21 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1832703002/700001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1832703002/700001
4 years, 8 months ago (2016-04-19 07:01:42 UTC) #53
commit-bot: I haz the power
Committed patchset #12 (id:700001)
4 years, 8 months ago (2016-04-19 08:07:49 UTC) #55
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/b54ee6567f200280a284fc466706962fa810e398 Cr-Commit-Position: refs/heads/master@{#388164}
4 years, 8 months ago (2016-04-19 08:09:32 UTC) #57
yzshen1
On 2016/04/19 08:09:32, commit-bot: I haz the power wrote: > Patchset 12 (id:??) landed as ...
4 years, 8 months ago (2016-04-19 15:43:21 UTC) #58
Sam McNally
4 years, 8 months ago (2016-04-20 00:04:58 UTC) #59
Message was sent while issue was closed.
On 2016/04/19 15:43:21, yzshen1 wrote:
> On 2016/04/19 08:09:32, commit-bot: I haz the power wrote:
> > Patchset 12 (id:??) landed as
> > https://crrev.com/b54ee6567f200280a284fc466706962fa810e398
> > Cr-Commit-Position: refs/heads/master@{#388164}
> 
> Hi, Sam.
> 
> According to the mail thread
>
https://groups.google.com/a/chromium.org/forum/#!topic/platform-architecture-...
> it seems people agreed on using "blink" as the variant instead of "wtf".
> 
> Are you planning to update that? Thanks!

Yes. This CL was starting to feel a bit big so it seemed easier to update that
in a follow-up CL: https://codereview.chromium.org/1902263004/.

Powered by Google App Engine
This is Rietveld 408576698