chromium/third_party/blink/renderer/platform/instrumentation/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("//third_party/blink/renderer/platform/platform.gni")

blink_platform_sources("instrumentation") {
  sources = [
    "canvas_memory_dump_provider.cc",
    "canvas_memory_dump_provider.h",
    "instance_counters.cc",
    "instance_counters.h",
    "instance_counters_memory_dump_provider.cc",
    "instance_counters_memory_dump_provider.h",
    "memory_pressure_listener.cc",
    "memory_pressure_listener.h",
    "partition_alloc_memory_dump_provider.cc",
    "partition_alloc_memory_dump_provider.h",
    "resource_coordinator/document_resource_coordinator.cc",
    "resource_coordinator/document_resource_coordinator.h",
    "resource_coordinator/renderer_resource_coordinator.cc",
    "resource_coordinator/renderer_resource_coordinator.h",
    "tracing/memory_cache_dump_provider.cc",
    "tracing/memory_cache_dump_provider.h",
    "tracing/trace_event.cc",
    "tracing/trace_event.h",
    "tracing/traced_value.cc",
    "tracing/traced_value.h",
    "tracing/web_memory_allocator_dump.cc",
    "tracing/web_memory_allocator_dump.h",
    "tracing/web_process_memory_dump.cc",
    "tracing/web_process_memory_dump.h",
    "use_counter.h",
  ]

  deps = [ "//services/service_manager/public/cpp" ]
  public_deps = [
    ":histogram",
    "//components/performance_manager/public/mojom:mojom_blink",
    "//third_party/blink/renderer/platform/heap:heap",
  ]
  allow_circular_includes_from = public_deps
}

component("histogram") {
  visibility = [ "//third_party/blink/renderer/platform/*" ]
  output_name = "blink_histogram"

  configs +=
      [ "//third_party/blink/renderer/platform:blink_platform_implementation" ]

  sources = [
    "histogram.cc",
    "histogram.h",
  ]
  public_deps = [
    "//base:base",
    "//third_party/blink/renderer/platform:platform_export",
    "//third_party/blink/renderer/platform/wtf:wtf",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "histogram_test.cc",
    "tracing/traced_value_test.cc",
    "tracing/web_process_memory_dump_test.cc",
  ]

  deps = [
    "//base",
    "//base/allocator:buildflags",
    "//base/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/blink/renderer/platform:platform",
  ]

  configs += [ "//third_party/blink/renderer/platform:blink_platform_config" ]
}