# Copyright 2016 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.

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

if (is_chromeos) {
  source_set("leak_detector") {
    sources = [
      "call_stack_manager.cc",
      "call_stack_manager.h",
      "call_stack_table.cc",
      "call_stack_table.h",
      "custom_allocator.cc",
      "custom_allocator.h",
      "gnu_build_id_reader.cc",
      "gnu_build_id_reader.h",
      "leak_analyzer.cc",
      "leak_analyzer.h",
      "leak_detector.cc",
      "leak_detector.h",
      "leak_detector_impl.cc",
      "leak_detector_impl.h",
      "leak_detector_value_type.cc",
      "leak_detector_value_type.h",
      "protobuf_to_mojo_converter.cc",
      "protobuf_to_mojo_converter.h",
      "ranked_set.cc",
      "ranked_set.h",
    ]

    deps = [
      ":interfaces",
      "//base",
      "//components/metrics/proto:proto",
    ]
  }

  mojom("interfaces") {
    sources = [
      "leak_detector.mojom",
    ]
  }

  source_set("unit_tests") {
    testonly = true
    sources = [
      "call_stack_manager_unittest.cc",
      "call_stack_table_unittest.cc",
      "leak_analyzer_unittest.cc",
      "leak_detector_impl_unittest.cc",
      "leak_detector_unittest.cc",
      "protobuf_to_mojo_converter_unittest.cc",
      "ranked_set_unittest.cc",
    ]

    deps = [
      ":interfaces",
      ":leak_detector",
      "//base",
      "//components/metrics/proto:proto",
      "//content/test:test_support",
      "//testing/gtest",
    ]
  }
}
