# Copyright 2014 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("//testing/test.gni") static_library("metrics") { sources = [ "call_stack_profile_metrics_provider.cc", "call_stack_profile_metrics_provider.h", "clean_exit_beacon.cc", "clean_exit_beacon.h", "client_info.cc", "client_info.h", "cloned_install_detector.cc", "cloned_install_detector.h", "daily_event.cc", "daily_event.h", "data_use_tracker.cc", "data_use_tracker.h", "delegating_provider.cc", "delegating_provider.h", "drive_metrics_provider.cc", "drive_metrics_provider.h", "drive_metrics_provider_android.cc", "drive_metrics_provider_ios.mm", "drive_metrics_provider_linux.cc", "drive_metrics_provider_mac.mm", "drive_metrics_provider_win.cc", "enabled_state_provider.cc", "enabled_state_provider.h", "environment_recorder.cc", "environment_recorder.h", "execution_phase.cc", "execution_phase.h", "expired_histograms_checker.cc", "expired_histograms_checker.h", "field_trials_provider.cc", "field_trials_provider.h", "file_metrics_provider.cc", "file_metrics_provider.h", "histogram_encoder.cc", "histogram_encoder.h", "log_decoder.cc", "log_decoder.h", "log_store.h", "machine_id_provider.h", "machine_id_provider_stub.cc", "machine_id_provider_win.cc", "metrics_log.cc", "metrics_log.h", "metrics_log_manager.cc", "metrics_log_manager.h", "metrics_log_store.cc", "metrics_log_store.h", "metrics_log_uploader.h", "metrics_pref_names.cc", "metrics_pref_names.h", "metrics_provider.cc", "metrics_provider.h", "metrics_reporting_default_state.cc", "metrics_reporting_default_state.h", "metrics_reporting_service.cc", "metrics_reporting_service.h", "metrics_rotation_scheduler.cc", "metrics_rotation_scheduler.h", "metrics_scheduler.cc", "metrics_scheduler.h", "metrics_service.cc", "metrics_service.h", "metrics_service_accessor.cc", "metrics_service_accessor.h", "metrics_service_client.cc", "metrics_service_client.h", "metrics_state_manager.cc", "metrics_state_manager.h", "metrics_switches.cc", "metrics_switches.h", "metrics_upload_scheduler.cc", "metrics_upload_scheduler.h", "persisted_logs.cc", "persisted_logs.h", "persisted_logs_metrics.h", "persisted_logs_metrics_impl.cc", "persisted_logs_metrics_impl.h", "persistent_system_profile.cc", "persistent_system_profile.h", "reporting_service.cc", "reporting_service.h", "stability_metrics_helper.cc", "stability_metrics_helper.h", "stability_metrics_provider.cc", "stability_metrics_provider.h", "system_memory_stats_recorder.h", "system_memory_stats_recorder_linux.cc", "system_memory_stats_recorder_win.cc", "url_constants.cc", "url_constants.h", "version_utils.cc", "version_utils.h", ] public_deps = [ "//components/metrics/proto", ] deps = [ ":call_stack_profile_params", "//base", "//base:base_static", "//components/prefs", "//components/variations", "//components/version_info:version_info", "//extensions/features:features", "//third_party/zlib/google:compression_utils", ] if (is_chromeos) { deps += [ ":serialization" ] } if (is_mac) { libs = [ # The below are all needed for drive_metrics_provider_mac.mm. "CoreFoundation.framework", "DiskArbitration.framework", "Foundation.framework", "IOKit.framework", ] } if (is_win) { sources -= [ "machine_id_provider_stub.cc" ] deps += [ "//components/browser_watcher:stability_client" ] } if (is_fuchsia) { sources += [ "drive_metrics_provider_fuchsia.cc" ] } } # The component metrics provider is a separate target because it depends upon # (the large) component_updater code, and is not needed for some entities that # depend on :metrics. static_library("component_metrics") { sources = [ "component_metrics_provider.cc", "component_metrics_provider.h", ] public_deps = [ "//components/metrics/proto", ] deps = [ ":metrics", "//base", "//components/component_updater", ] } if (!is_ios) { static_library("gpu") { sources = [ "gpu/gpu_metrics_provider.cc", "gpu/gpu_metrics_provider.h", ] public_deps = [ ":metrics", ] deps = [ "//base", "//content/public/browser", "//gpu/config", ] } } static_library("net") { sources = [ "net/cellular_logic_helper.cc", "net/cellular_logic_helper.h", "net/net_metrics_log_uploader.cc", "net/net_metrics_log_uploader.h", "net/network_metrics_provider.cc", "net/network_metrics_provider.h", "net/wifi_access_point_info_provider.cc", "net/wifi_access_point_info_provider.h", ] public_deps = [ ":metrics", ] allow_circular_includes_from = [ ":metrics" ] deps = [ "//base", "//components/data_use_measurement/core", "//components/variations", "//net", "//url", ] if (is_chromeos) { sources += [ "net/wifi_access_point_info_provider_chromeos.cc", "net/wifi_access_point_info_provider_chromeos.h", ] deps += [ "//chromeos" ] } } static_library("ui") { sources = [ "ui/screen_info_metrics_provider.cc", "ui/screen_info_metrics_provider.h", ] public_deps = [ ":metrics", ] deps = [ "//base", "//ui/display", "//ui/gfx", "//ui/gfx/geometry", ] } static_library("single_sample_metrics") { sources = [ "single_sample_metrics.cc", "single_sample_metrics.h", "single_sample_metrics_factory_impl.cc", "single_sample_metrics_factory_impl.h", ] deps = [ "//mojo/public/cpp/bindings", "//services/service_manager/public/cpp", "//services/service_manager/public/interfaces", ] public_deps = [ "//components/metrics/public/interfaces:single_sample_metrics_mojo_bindings", ] } source_set("call_stack_profile_params") { sources = [ "call_stack_profile_params.h", ] deps = [ "//base:base", ] } source_set("call_stacks") { sources = [ "call_stack_profile_collector.cc", "call_stack_profile_collector.h", ] deps = [ ":metrics", "//components/metrics/public/interfaces:call_stack_mojo_bindings", ] } source_set("child_call_stacks") { sources = [ "child_call_stack_profile_collector.cc", "child_call_stack_profile_collector.h", ] deps = [ "//components/metrics/public/interfaces:call_stack_mojo_bindings", "//services/service_manager/public/cpp", ] } static_library("test_support") { testonly = true sources = [ "test_enabled_state_provider.cc", "test_enabled_state_provider.h", "test_metrics_log_uploader.cc", "test_metrics_log_uploader.h", "test_metrics_provider.cc", "test_metrics_provider.h", "test_metrics_service_client.cc", "test_metrics_service_client.h", ] public_deps = [ ":metrics", ] deps = [ "//base", ] } if (is_linux) { static_library("serialization") { sources = [ "serialization/metric_sample.cc", "serialization/metric_sample.h", "serialization/serialization_utils.cc", "serialization/serialization_utils.h", ] deps = [ "//base", ] } } source_set("unit_tests") { testonly = true sources = [ "call_stack_profile_metrics_provider_unittest.cc", "child_call_stack_profile_collector_unittest.cc", "cloned_install_detector_unittest.cc", "daily_event_unittest.cc", "data_use_tracker_unittest.cc", "drive_metrics_provider_unittest.cc", "environment_recorder_unittest.cc", "field_trials_provider_unittest.cc", "file_metrics_provider_unittest.cc", "histogram_encoder_unittest.cc", "machine_id_provider_win_unittest.cc", "metrics_log_manager_unittest.cc", "metrics_log_store_unittest.cc", "metrics_log_unittest.cc", "metrics_service_unittest.cc", "metrics_state_manager_unittest.cc", "net/net_metrics_log_uploader_unittest.cc", "net/network_metrics_provider_unittest.cc", "persisted_logs_unittest.cc", "persistent_system_profile_unittest.cc", "single_sample_metrics_factory_impl_unittest.cc", "stability_metrics_helper_unittest.cc", "stability_metrics_provider_unittest.cc", "ui/screen_info_metrics_provider_unittest.cc", ] deps = [ ":call_stack_profile_params", ":child_call_stacks", ":component_metrics", ":metrics", ":net", ":single_sample_metrics", ":test_support", ":ui", "//base/test:test_support", "//components/metrics/public/cpp:call_stack_unit_tests", "//components/prefs:test_support", "//components/variations", "//extensions/features:features", "//mojo/public/cpp/bindings", "//net:test_support", "//services/service_manager/public/cpp", "//testing/gtest", "//third_party/zlib/google:compression_utils", "//ui/gfx/geometry", ] if (is_linux) { sources += [ "serialization/serialization_utils_unittest.cc" ] deps += [ ":serialization" ] } if (is_chromeos) { deps += [ "leak_detector:unit_tests", "//chromeos", ] } # iOS is not supported by the profiler and the ios-simulator bot chokes on # these tests. if (is_ios) { sources -= [ "child_call_stack_profile_collector_unittest.cc" ] deps -= [ "//components/metrics/public/cpp:call_stack_unit_tests" ] } } # Convenience testing target test("metrics_unittests") { sources = [ "//components/test/run_all_unittests.cc", ] deps = [ ":unit_tests", "//components/test:test_support", ] }