chromium/ui/latency/mojom/BUILD.gn

# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//mojo/public/tools/bindings/mojom.gni")

component("shared_mojom_traits") {
  output_name = "latency_shared_mojom_traits"
  defines = [ "IS_LATENCY_SHARED_MOJOM_TRAITS_IMPL" ]
  sources = [
    "latency_info_mojom_traits.cc",
    "latency_info_mojom_traits.h",
  ]
  public_deps = [
    ":mojom_shared",
    "//ipc:param_traits",
    "//ui/latency",
  ]
}

mojom("mojom") {
  generate_java = true
  sources = [ "latency_info.mojom" ]

  public_deps = [ "//mojo/public/mojom/base" ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "ui.mojom.LatencyComponentType"
          cpp = "::ui::LatencyComponentType"
        },
        {
          mojom = "ui.mojom.LatencyInfo"
          cpp = "::ui::LatencyInfo"
        },
      ]
      traits_headers = [ "latency_info_mojom_traits.h" ]
      traits_public_deps = [
        ":shared_mojom_traits",
        "//ui/latency",
      ]
    },
  ]
  blink_cpp_typemaps = cpp_typemaps

  # Generate WebUI bindings in TypeScript and legacy bindings in JS (for Blink)
  webui_module_path = "chrome://resources/mojo/ui/latency/mojom"
  generate_legacy_js_bindings = true
}

mojom("test_interfaces") {
  testonly = true
  sources = [ "traits_test_service.mojom" ]

  public_deps = [ ":mojom" ]
}