Commit 81b38e95 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Move //ipc typemap into GN rule

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: default avatarTom 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}
parent 3e5b9154
...@@ -192,11 +192,39 @@ mojom_component("mojom") { ...@@ -192,11 +192,39 @@ mojom_component("mojom") {
"//mojo/public/mojom/base", "//mojo/public/mojom/base",
] ]
cpp_typemaps = [ ":message_typemap" ]
# Don't generate a variant sources since we depend on generated internal # Don't generate a variant sources since we depend on generated internal
# bindings types and we don't generate or build variants of those. # bindings types and we don't generate or build variants of those.
disable_variants = true 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") { mojom("mojom_constants") {
sources = [ "constants.mojom" ] sources = [ "constants.mojom" ]
} }
......
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
mojom = "//ipc/ipc.mojom"
public_headers = [ "//ipc/message_view.h" ]
traits_headers = [ "//ipc/message_mojom_traits.h" ]
sources = [
"//ipc/message_mojom_traits.cc",
"//ipc/message_mojom_traits.h",
"//ipc/message_view.cc",
"//ipc/message_view.h",
]
public_deps = [
"//ipc:message_support",
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [ "IPC.mojom.Message=::IPC::MessageView[move_only]" ]
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
typemaps = [ "//ipc/message.typemap" ]
...@@ -29,7 +29,6 @@ _typemap_imports = [ ...@@ -29,7 +29,6 @@ _typemap_imports = [
"//device/vr/public/mojom/typemaps.gni", "//device/vr/public/mojom/typemaps.gni",
"//fuchsia/mojom/test_typemaps.gni", "//fuchsia/mojom/test_typemaps.gni",
"//gpu/ipc/common/typemaps.gni", "//gpu/ipc/common/typemaps.gni",
"//ipc/typemaps.gni",
"//media/capture/mojom/typemaps.gni", "//media/capture/mojom/typemaps.gni",
"//media/fuchsia/mojom/typemaps.gni", "//media/fuchsia/mojom/typemaps.gni",
"//media/learning/mojo/public/cpp/typemaps.gni", "//media/learning/mojo/public/cpp/typemaps.gni",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment