Skip to content

Commit

Permalink
Move //ipc typemap into GN rule
Browse files Browse the repository at this point in the history
This also serves as a simple example of
converting a typemap with inlined sources
on a mojom_component target.

Bug: 1059389
Change-Id: If80faa47cdfcebf7c36c80d1ef6a611cb31bd69e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094336
Auto-Submit: Ken Rockot <rockot@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#748791}
  • Loading branch information
krockot authored and Commit Bot committed Mar 10, 2020
1 parent 3e5b915 commit 81b38e9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
28 changes: 28 additions & 0 deletions ipc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,39 @@ mojom_component("mojom") {
"//mojo/public/mojom/base",
]

cpp_typemaps = [ ":message_typemap" ]

# Don't generate a variant sources since we depend on generated internal
# bindings types and we don't generate or build variants of those.
disable_variants = true
}

mojom_cpp_typemap("message_typemap") {
types = [
{
mojom = "IPC.mojom.Message"
cpp = "::IPC::MessageView"
move_only = true
},
]
public_headers = [
"//ipc/message_mojom_traits.h",
"//ipc/message_view.h",
]
traits_sources = [
"//ipc/message_mojom_traits.cc",
"//ipc/message_mojom_traits.h",
"//ipc/message_view.cc",
"//ipc/message_view.h",
]
traits_public_deps = [
":mojom_shared",
"//ipc:message_support",
"//mojo/public/cpp/base:shared_typemap_traits",
]
traits_defines = [ "IS_IPC_MOJOM_IMPL" ]
}

mojom("mojom_constants") {
sources = [ "constants.mojom" ]
}
Expand Down
18 changes: 0 additions & 18 deletions ipc/message.typemap

This file was deleted.

5 changes: 0 additions & 5 deletions ipc/typemaps.gni

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ _typemap_imports = [
"//device/vr/public/mojom/typemaps.gni",
"//fuchsia/mojom/test_typemaps.gni",
"//gpu/ipc/common/typemaps.gni",
"//ipc/typemaps.gni",
"//media/capture/mojom/typemaps.gni",
"//media/fuchsia/mojom/typemaps.gni",
"//media/learning/mojo/public/cpp/typemaps.gni",
Expand Down

0 comments on commit 81b38e9

Please sign in to comment.