chromium/services/resource_coordinator/public/mojom/BUILD.gn

# Copyright 2017 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")

mojom_component("mojom") {
  output_prefix = "resource_coordinator_public_mojom"
  macro_prefix = "RESOURCE_COORDINATOR_PUBLIC_MOJOM"

  sources = [
    "memory_instrumentation/constants.mojom",
    "memory_instrumentation/memory_instrumentation.mojom",
  ]

  public_deps = [
    "//mojo/public/mojom/base",
    "//services/metrics/public/mojom",
  ]

  enabled_features = []
  if (is_linux || is_chromeos || is_android) {
    enabled_features += [ "private_swap_info" ]
  }

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "memory_instrumentation.mojom.DumpType"
          cpp = "::base::trace_event::MemoryDumpType"
        },
        {
          mojom = "memory_instrumentation.mojom.LevelOfDetail"
          cpp = "::base::trace_event::MemoryDumpLevelOfDetail"
        },
        {
          mojom = "memory_instrumentation.mojom.Determinism"
          cpp = "::base::trace_event::MemoryDumpDeterminism"
        },
        {
          mojom = "memory_instrumentation.mojom.RequestArgs"
          cpp = "::base::trace_event::MemoryDumpRequestArgs"
        },
        {
          mojom = "memory_instrumentation.mojom.RawAllocatorDumpEdge"
          cpp =
              "::base::trace_event::ProcessMemoryDump::MemoryAllocatorDumpEdge"
        },
        {
          mojom = "memory_instrumentation.mojom.RawAllocatorDumpEntry"
          cpp = "::base::trace_event::MemoryAllocatorDump::Entry"
          move_only = true
        },
        {
          mojom = "memory_instrumentation.mojom.RawAllocatorDump"
          cpp = "::std::unique_ptr<::base::trace_event::MemoryAllocatorDump>"
          move_only = true
        },
        {
          mojom = "memory_instrumentation.mojom.RawProcessMemoryDump"
          cpp = "::std::unique_ptr<::base::trace_event::ProcessMemoryDump>"
          move_only = true
          nullable_is_same_type = true
        },
      ]
      traits_headers = [ "//services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation_mojom_traits.h" ]
      traits_sources = [ "//services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation_mojom_traits.cc" ]
      traits_public_deps = [ "//base" ]
    },
  ]
}