Commit e4f2e4c6 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Remove os_whitelist from mojom GN template

This feature has two problems:

- its name is bad and non-inclusive
- it's no longer needed with inlined typemap definitions

This converts the one remaining dependent typemap to an inlined
typemap configuration in GN.

Fixed: 1097211
Change-Id: I9515ada1bc833f1306f12b2bcae14a59f1257645
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2255123
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Auto-Submit: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#781480}
parent f04665cf
...@@ -10,6 +10,26 @@ import("//testing/test.gni") ...@@ -10,6 +10,26 @@ import("//testing/test.gni")
mojom("example_interfaces") { mojom("example_interfaces") {
testonly = true testonly = true
sources = [ "example.mojom" ] sources = [ "example.mojom" ]
cpp_typemaps = [
{
types = [
{
mojom = "fuchsia.test.mojom.TestInterfaceRequest"
cpp = "::fidl::InterfaceRequest<::base::fuchsia::testfidl::TestInterface>"
move_only = true
},
]
traits_headers = [
"//base/fuchsia/testfidl/cpp/fidl.h",
"//fuchsia/mojom/test_interface_request_mojom_traits.h",
]
traits_public_deps = [
":traits",
"//base:testfidl",
]
},
]
} }
source_set("traits") { source_set("traits") {
......
...@@ -2,5 +2,3 @@ per-file *.mojom=set noparent ...@@ -2,5 +2,3 @@ per-file *.mojom=set noparent
per-file *.mojom=file://ipc/SECURITY_OWNERS per-file *.mojom=file://ipc/SECURITY_OWNERS
per-file *_mojom_traits*.*=set noparent per-file *_mojom_traits*.*=set noparent
per-file *_mojom_traits*.*=file://ipc/SECURITY_OWNERS per-file *_mojom_traits*.*=file://ipc/SECURITY_OWNERS
per-file *.typemap=set noparent
per-file *.typemap=file://ipc/SECURITY_OWNERS
# Copyright 2019 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 = "//fuchsia/mojom/example.mojom"
os_whitelist = [ "fuchsia" ]
public_headers = [ "base/fuchsia/testfidl/cpp/fidl.h" ]
traits_headers = [ "//fuchsia/mojom/test_interface_request_mojom_traits.h" ]
sources = [
"//fuchsia/mojom/test_interface_request_mojom_traits.h",
]
public_deps = [
"//base:testfidl",
"//fuchsia/mojom:traits",
]
type_mappings = [ "fuchsia.test.mojom.TestInterfaceRequest=::fidl::InterfaceRequest<::base::fuchsia::testfidl::TestInterface>[move_only]" ]
# Copyright 2019 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 = [ "//fuchsia/mojom/example.typemap" ]
...@@ -21,7 +21,6 @@ _typemap_imports = [ ...@@ -21,7 +21,6 @@ _typemap_imports = [
"//components/typemaps.gni", "//components/typemaps.gni",
"//content/browser/typemaps.gni", "//content/browser/typemaps.gni",
"//content/public/common/typemaps.gni", "//content/public/common/typemaps.gni",
"//fuchsia/mojom/test_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",
......
...@@ -1108,33 +1108,7 @@ template("mojom") { ...@@ -1108,33 +1108,7 @@ template("mojom") {
} }
_typemap_config = typemap.config _typemap_config = typemap.config
if (get_path_info(source, "abspath") == _typemap_config.mojom) { if (get_path_info(source, "abspath") == _typemap_config.mojom) {
enabled = false active_typemaps += [ typemap ]
if (!defined(_typemap_config.os_whitelist)) {
enabled = true
} else {
foreach(os, _typemap_config.os_whitelist) {
if (os == "android" && is_android) {
enabled = true
} else if (os == "chromeos" && is_chromeos) {
enabled = true
} else if (os == "fuchsia" && is_fuchsia) {
enabled = true
} else if (os == "ios" && is_ios) {
enabled = true
} else if (os == "linux" && is_linux) {
enabled = true
} else if (os == "mac" && is_mac) {
enabled = true
} else if (os == "posix" && is_posix) {
enabled = true
} else if (os == "win" && is_win) {
enabled = true
}
}
}
if (enabled) {
active_typemaps += [ typemap ]
}
} }
} }
} }
......
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