| # Copyright 2019 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//components/guest_view/buildflags/buildflags.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| proto_library("site_data_proto") { |
| sources = [ "persistence/site_data/site_data.proto" ] |
| } |
| |
| static_library("performance_manager") { |
| sources = [ |
| "binders.cc", |
| "browser_child_process_host_proxy.cc", |
| "browser_child_process_watcher.cc", |
| "browser_child_process_watcher.h", |
| "decorators/frame_input_state_decorator.cc", |
| "decorators/frame_input_state_decorator.h", |
| "decorators/frame_visibility_decorator.cc", |
| "decorators/frame_visibility_decorator.h", |
| "decorators/important_frame_decorator.cc", |
| "decorators/important_frame_decorator.h", |
| "decorators/page_aggregator.cc", |
| "decorators/page_aggregator.h", |
| "decorators/page_aggregator_data.cc", |
| "decorators/page_aggregator_data.h", |
| "decorators/page_live_state_decorator.cc", |
| "decorators/page_load_tracker_decorator.cc", |
| "decorators/page_load_tracker_decorator.h", |
| "decorators/page_load_tracker_decorator_data.cc", |
| "decorators/page_load_tracker_decorator_data.h", |
| "decorators/page_load_tracker_decorator_helper.cc", |
| "decorators/process_hosted_content_types_aggregator.cc", |
| "decorators/process_hosted_content_types_aggregator.h", |
| "decorators/process_metrics_decorator.cc", |
| "decorators/process_priority_aggregator.cc", |
| "decorators/process_priority_aggregator.h", |
| "decorators/process_priority_aggregator_data.cc", |
| "decorators/process_priority_aggregator_data.h", |
| "decorators/site_data_node_data.cc", |
| "decorators/site_data_node_data.h", |
| "decorators/site_data_recorder.cc", |
| "decorators/tab_page_decorator.cc", |
| "embedder/binders.h", |
| "embedder/graph_features.h", |
| "embedder/performance_manager_lifetime.h", |
| "embedder/performance_manager_registry.h", |
| "embedder/scoped_global_scenario_memory.h", |
| "execution_context/execution_context_impl.cc", |
| "execution_context/execution_context_impl.h", |
| "execution_context/execution_context_registry_impl.cc", |
| "execution_context/execution_context_registry_impl.h", |
| "execution_context_priority/boosting_vote_aggregator.cc", |
| "execution_context_priority/boosting_vote_aggregator.h", |
| "execution_context_priority/execution_context_priority.cc", |
| "execution_context_priority/frame_audible_voter.cc", |
| "execution_context_priority/frame_audible_voter.h", |
| "execution_context_priority/frame_capturing_media_stream_voter.cc", |
| "execution_context_priority/frame_capturing_media_stream_voter.h", |
| "execution_context_priority/frame_visibility_voter.cc", |
| "execution_context_priority/frame_visibility_voter.h", |
| "execution_context_priority/inherit_client_priority_voter.cc", |
| "execution_context_priority/inherit_client_priority_voter.h", |
| "execution_context_priority/inherit_parent_priority_voter.cc", |
| "execution_context_priority/inherit_parent_priority_voter.h", |
| "execution_context_priority/loading_page_voter.cc", |
| "execution_context_priority/loading_page_voter.h", |
| "execution_context_priority/max_vote_aggregator.cc", |
| "execution_context_priority/override_vote_aggregator.cc", |
| "execution_context_priority/priority_voting_system.cc", |
| "execution_context_priority/root_vote_observer.cc", |
| "execution_context_priority/root_vote_observer.h", |
| "features.cc", |
| "frame_node_source.h", |
| "freezing/cannot_freeze_reason.cc", |
| "freezing/freezer.cc", |
| "freezing/freezer.h", |
| "freezing/freezing.cc", |
| "freezing/freezing_policy.cc", |
| "freezing/freezing_policy.h", |
| "freezing/frozen_data.cc", |
| "freezing/frozen_data.h", |
| "freezing/frozen_frame_aggregator.cc", |
| "freezing/frozen_frame_aggregator.h", |
| "graph/frame_node.cc", |
| "graph/frame_node_impl.cc", |
| "graph/frame_node_impl.h", |
| "graph/frame_node_impl_describer.cc", |
| "graph/frame_node_impl_describer.h", |
| "graph/graph.cc", |
| "graph/graph_impl.cc", |
| "graph/graph_impl.h", |
| "graph/graph_impl_operations.cc", |
| "graph/graph_impl_operations.h", |
| "graph/graph_impl_util.h", |
| "graph/graph_operations.cc", |
| "graph/graph_registered.cc", |
| "graph/node.cc", |
| "graph/node_attached_data.cc", |
| "graph/node_attached_data_storage.cc", |
| "graph/node_attached_data_storage.h", |
| "graph/node_base.cc", |
| "graph/node_base.h", |
| "graph/node_data_describer.cc", |
| "graph/node_data_describer_util.cc", |
| "graph/node_inline_data.h", |
| "graph/node_inline_data_impl.h", |
| "graph/page_node.cc", |
| "graph/page_node_impl.cc", |
| "graph/page_node_impl.h", |
| "graph/page_node_impl_describer.cc", |
| "graph/page_node_impl_describer.h", |
| "graph/policies/bfcache_policy.cc", |
| "graph/policies/bfcache_policy.h", |
| "graph/process_node.cc", |
| "graph/process_node_impl.cc", |
| "graph/process_node_impl.h", |
| "graph/process_node_impl_describer.cc", |
| "graph/process_node_impl_describer.h", |
| "graph/properties.h", |
| "graph/system_node.cc", |
| "graph/system_node_impl.cc", |
| "graph/system_node_impl.h", |
| "graph/worker_node.cc", |
| "graph/worker_node_impl.cc", |
| "graph/worker_node_impl.h", |
| "graph/worker_node_impl_describer.cc", |
| "graph/worker_node_impl_describer.h", |
| "graph_features.cc", |
| "metrics/metrics_collector.cc", |
| "metrics/page_resource_monitor.cc", |
| "owned_objects.h", |
| "performance_manager.cc", |
| "performance_manager_feature_observer_client.cc", |
| "performance_manager_feature_observer_client.h", |
| "performance_manager_impl.cc", |
| "performance_manager_impl.h", |
| "performance_manager_lifetime.cc", |
| "performance_manager_registry.cc", |
| "performance_manager_registry_impl.cc", |
| "performance_manager_registry_impl.h", |
| "performance_manager_tab_helper.cc", |
| "performance_manager_tab_helper.h", |
| "persistence/site_data/exponential_moving_average.cc", |
| "persistence/site_data/exponential_moving_average.h", |
| "persistence/site_data/leveldb_site_data_store.cc", |
| "persistence/site_data/leveldb_site_data_store.h", |
| "persistence/site_data/non_recording_site_data_cache.cc", |
| "persistence/site_data/non_recording_site_data_cache.h", |
| "persistence/site_data/noop_site_data_writer.cc", |
| "persistence/site_data/noop_site_data_writer.h", |
| "persistence/site_data/site_data_cache.h", |
| "persistence/site_data/site_data_cache_factory.cc", |
| "persistence/site_data/site_data_cache_factory.h", |
| "persistence/site_data/site_data_cache_impl.cc", |
| "persistence/site_data/site_data_cache_impl.h", |
| "persistence/site_data/site_data_cache_inspector.h", |
| "persistence/site_data/site_data_impl.cc", |
| "persistence/site_data/site_data_impl.h", |
| "persistence/site_data/site_data_reader.cc", |
| "persistence/site_data/site_data_store.h", |
| "persistence/site_data/site_data_writer.cc", |
| "persistence/site_data/site_data_writer.h", |
| "persistence/site_data/tab_visibility.h", |
| "power/battery_level_provider_creator.cc", |
| "public/browser_child_process_host_id.h", |
| "public/browser_child_process_host_proxy.h", |
| "public/decorators/page_live_state_decorator.h", |
| "public/decorators/page_load_tracker_decorator_helper.h", |
| "public/decorators/process_metrics_decorator.h", |
| "public/decorators/site_data_recorder.h", |
| "public/decorators/tab_page_decorator.h", |
| "public/execution_context/execution_context.h", |
| "public/execution_context/execution_context_attached_data.h", |
| "public/execution_context/execution_context_registry.h", |
| "public/execution_context_priority/execution_context_priority.h", |
| "public/execution_context_priority/max_vote_aggregator.h", |
| "public/execution_context_priority/override_vote_aggregator.h", |
| "public/execution_context_priority/priority_voting_system.h", |
| "public/features.h", |
| "public/freezing/cannot_freeze_reason.h", |
| "public/freezing/freezing.h", |
| "public/graph/frame_node.h", |
| "public/graph/graph.h", |
| "public/graph/graph_operations.h", |
| "public/graph/graph_registered.h", |
| "public/graph/node.h", |
| "public/graph/node_attached_data.h", |
| "public/graph/node_data_describer.h", |
| "public/graph/node_data_describer_registry.h", |
| "public/graph/node_data_describer_util.h", |
| "public/graph/node_set_view.h", |
| "public/graph/node_state.h", |
| "public/graph/node_type.h", |
| "public/graph/page_node.h", |
| "public/graph/process_node.h", |
| "public/graph/system_node.h", |
| "public/graph/worker_node.h", |
| "public/metrics/metrics_collector.h", |
| "public/metrics/page_resource_monitor.h", |
| "public/performance_manager.h", |
| "public/performance_manager_observer.h", |
| "public/persistence/site_data/feature_usage.h", |
| "public/persistence/site_data/site_data_reader.h", |
| "public/power/battery_level_provider_creator.h", |
| "public/render_frame_host_proxy.h", |
| "public/render_process_host_id.h", |
| "public/render_process_host_proxy.h", |
| "public/resource_attribution/attribution_helpers.h", |
| "public/resource_attribution/cpu_measurement_delegate.h", |
| "public/resource_attribution/cpu_proportion_tracker.h", |
| "public/resource_attribution/frame_context.h", |
| "public/resource_attribution/memory_measurement_delegate.h", |
| "public/resource_attribution/origin_in_browsing_instance_context.h", |
| "public/resource_attribution/page_context.h", |
| "public/resource_attribution/process_context.h", |
| "public/resource_attribution/queries.h", |
| "public/resource_attribution/query_results.h", |
| "public/resource_attribution/resource_contexts.h", |
| "public/resource_attribution/resource_types.h", |
| "public/resource_attribution/type_helpers.h", |
| "public/resource_attribution/worker_context.h", |
| "public/scenarios/process_performance_scenarios.h", |
| "public/tracing_support.h", |
| "public/user_tuning/prefs.h", |
| "public/user_tuning/tab_revisit_tracker.h", |
| "public/v8_memory/v8_detailed_memory.h", |
| "public/v8_memory/web_memory.h", |
| "public/viewport_intersection.h", |
| "public/voting/optional_voting_channel.h", |
| "public/voting/voting.h", |
| "registered_objects.h", |
| "render_frame_host_proxy.cc", |
| "render_process_host_proxy.cc", |
| "render_process_user_data.cc", |
| "render_process_user_data.h", |
| "resource_attribution/attribution_impl_helpers.h", |
| "resource_attribution/context_collection.cc", |
| "resource_attribution/context_collection.h", |
| "resource_attribution/cpu_measurement_data.cc", |
| "resource_attribution/cpu_measurement_data.h", |
| "resource_attribution/cpu_measurement_delegate.cc", |
| "resource_attribution/cpu_measurement_monitor.cc", |
| "resource_attribution/cpu_measurement_monitor.h", |
| "resource_attribution/cpu_proportion_tracker.cc", |
| "resource_attribution/frame_context.cc", |
| "resource_attribution/graph_change.cc", |
| "resource_attribution/graph_change.h", |
| "resource_attribution/memory_measurement_delegate.cc", |
| "resource_attribution/memory_measurement_provider.cc", |
| "resource_attribution/memory_measurement_provider.h", |
| "resource_attribution/node_data_describers.cc", |
| "resource_attribution/node_data_describers.h", |
| "resource_attribution/origin_in_browsing_instance_context.cc", |
| "resource_attribution/page_context.cc", |
| "resource_attribution/performance_manager_aliases.h", |
| "resource_attribution/process_context.cc", |
| "resource_attribution/queries.cc", |
| "resource_attribution/query_params.cc", |
| "resource_attribution/query_params.h", |
| "resource_attribution/query_scheduler.cc", |
| "resource_attribution/query_scheduler.h", |
| "resource_attribution/worker_client_pages.cc", |
| "resource_attribution/worker_client_pages.h", |
| "resource_attribution/worker_context.cc", |
| "scenarios/browser_performance_scenarios.cc", |
| "scenarios/browser_performance_scenarios.h", |
| "scenarios/input_scenario_observer.cc", |
| "scenarios/input_scenario_observer.h", |
| "scenarios/loading_scenario_data.cc", |
| "scenarios/loading_scenario_data.h", |
| "scenarios/loading_scenario_observer.cc", |
| "scenarios/loading_scenario_observer.h", |
| "scenarios/performance_scenario_data.cc", |
| "scenarios/performance_scenario_data.h", |
| "scenarios/process_performance_scenarios.cc", |
| "scenarios/scoped_global_scenario_memory.cc", |
| "service_worker_context_adapter.cc", |
| "service_worker_context_adapter.h", |
| "tab_helper_frame_node_source.cc", |
| "tab_helper_frame_node_source.h", |
| "tracing_support.cc", |
| "user_tuning/prefs.cc", |
| "user_tuning/tab_revisit_tracker.cc", |
| "v8_memory/v8_context_tracker.cc", |
| "v8_memory/v8_context_tracker.h", |
| "v8_memory/v8_context_tracker_helpers.cc", |
| "v8_memory/v8_context_tracker_helpers.h", |
| "v8_memory/v8_context_tracker_internal.cc", |
| "v8_memory/v8_context_tracker_internal.h", |
| "v8_memory/v8_detailed_memory.cc", |
| "v8_memory/v8_detailed_memory_decorator.cc", |
| "v8_memory/v8_detailed_memory_decorator.h", |
| "v8_memory/web_memory_aggregator.cc", |
| "v8_memory/web_memory_aggregator.h", |
| "v8_memory/web_memory_impl.cc", |
| "v8_memory/web_memory_impl.h", |
| "worker_watcher.cc", |
| "worker_watcher.h", |
| ] |
| |
| deps = [ |
| "//components/content_settings/core/common", |
| "//components/guest_view/buildflags", |
| "//components/metrics", |
| "//components/performance_manager/scenario_api", |
| "//components/pref_registry", |
| "//components/prefs", |
| "//components/system_cpu", |
| "//third_party/blink/public/common:headers", |
| ] |
| |
| public_deps = [ |
| ":site_data_proto", |
| "//base", |
| "//base/allocator:buildflags", |
| "//components/performance_manager/public/mojom", |
| "//content/public/browser", |
| "//services/metrics/public/cpp:metrics_cpp", |
| "//services/metrics/public/cpp:ukm_builders", |
| "//third_party/blink/public/common", |
| "//third_party/leveldatabase", |
| "//url", |
| ] |
| |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| |
| if (enable_guest_view) { |
| deps += [ "//components/guest_view/browser" ] |
| } |
| |
| if (!is_android) { |
| sources += [ |
| "graph/policies/process_priority_policy.cc", |
| "graph/policies/process_priority_policy.h", |
| ] |
| } |
| |
| if (is_chromeos) { |
| deps += [ |
| "//chromeos/dbus/power", |
| "//chromeos/dbus/power:power_manager_proto", |
| ] |
| |
| sources += [ |
| "power/battery_level_provider_chromeos.cc", |
| "power/battery_level_provider_chromeos.h", |
| "power/dbus_power_manager_sampling_event_source.cc", |
| "power/dbus_power_manager_sampling_event_source.h", |
| ] |
| } |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| |
| sources = [ |
| "decorators/decorators_utils_unittest.cc", |
| "decorators/frame_input_state_decorator_unittest.cc", |
| "decorators/frame_visibility_decorator_unittest.cc", |
| "decorators/important_frame_decorator_unittest.cc", |
| "decorators/page_aggregator_unittest.cc", |
| "decorators/page_live_state_decorator_unittest.cc", |
| "decorators/page_load_tracker_decorator_unittest.cc", |
| "decorators/process_hosted_content_types_aggregator_unittest.cc", |
| "decorators/process_metrics_decorator_unittest.cc", |
| "decorators/process_priority_aggregator_unittest.cc", |
| "decorators/tab_page_decorator_unittest.cc", |
| "execution_context/execution_context_attached_data_unittest.cc", |
| "execution_context/execution_context_registry_impl_unittest.cc", |
| "execution_context_priority/boosting_vote_aggregator_unittest.cc", |
| "execution_context_priority/execution_context_priority_unittest.cc", |
| "execution_context_priority/frame_audible_voter_unittest.cc", |
| "execution_context_priority/frame_capturing_media_stream_voter_unittest.cc", |
| "execution_context_priority/frame_visibility_voter_unittest.cc", |
| "execution_context_priority/inherit_client_priority_voter_unittest.cc", |
| "execution_context_priority/inherit_parent_priority_voter_unittest.cc", |
| "execution_context_priority/loading_page_voter_unittest.cc", |
| "execution_context_priority/max_vote_aggregator_unittest.cc", |
| "execution_context_priority/override_vote_aggregator_unittest.cc", |
| "execution_context_priority/root_vote_observer_unittest.cc", |
| "freezing/frozen_frame_aggregator_unittest.cc", |
| "graph/frame_node_impl_unittest.cc", |
| "graph/graph_impl_operations_unittest.cc", |
| "graph/graph_impl_unittest.cc", |
| "graph/graph_operations_unittest.cc", |
| "graph/graph_registered_unittest.cc", |
| "graph/node_attached_data_unittest.cc", |
| "graph/node_base_unittest.cc", |
| "graph/node_data_describer_util_unittest.cc", |
| "graph/node_inline_data_unittest.cc", |
| "graph/node_set_view_unittest.cc", |
| "graph/page_node_impl_unittest.cc", |
| "graph/process_node_impl_unittest.cc", |
| "graph/properties_unittest.cc", |
| "graph/system_node_impl_unittest.cc", |
| "graph/worker_node_impl_unittest.cc", |
| "graph_features_unittest.cc", |
| "metrics/metrics_collector_unittest.cc", |
| "metrics/page_resource_monitor_unittest.cc", |
| "owned_objects_unittest.cc", |
| "performance_manager_impl_unittest.cc", |
| "performance_manager_registry_impl_unittest.cc", |
| "performance_manager_tab_helper_unittest.cc", |
| "performance_manager_unittest.cc", |
| "registered_objects_unittest.cc", |
| "render_process_host_id_unittest.cc", |
| "resource_attribution/cpu_measurement_monitor_unittest.cc", |
| "resource_attribution/frame_context_unittest.cc", |
| "resource_attribution/origin_in_browsing_instance_context_unittest.cc", |
| "resource_attribution/page_context_unittest.cc", |
| "resource_attribution/process_context_unittest.cc", |
| "resource_attribution/queries_unittest.cc", |
| "resource_attribution/query_scheduler_unittest.cc", |
| "resource_attribution/resource_contexts_unittest.cc", |
| "resource_attribution/type_helpers_unittest.cc", |
| "resource_attribution/worker_context_unittest.cc", |
| "scenarios/browser_performance_scenarios_unittest.cc", |
| "scenarios/input_scenario_observer_unittest.cc", |
| "scenarios/loading_scenario_observer_unittest.cc", |
| "scenarios/process_performance_scenarios_unittest.cc", |
| "test_support/mock_graphs_unittest.cc", |
| "user_tuning/prefs_unittest.cc", |
| "user_tuning/tab_revisit_tracker_unittest.cc", |
| "v8_memory/v8_context_tracker_helpers_unittest.cc", |
| "v8_memory/v8_context_tracker_internal_unittest.cc", |
| "v8_memory/v8_context_tracker_unittest.cc", |
| "v8_memory/v8_detailed_memory_unittest.cc", |
| "v8_memory/v8_memory_test_helpers.cc", |
| "v8_memory/v8_memory_test_helpers.h", |
| "v8_memory/web_memory_aggregator_unittest.cc", |
| "v8_memory/web_memory_impl_unittest.cc", |
| "voting/optional_voting_channel_unittest.cc", |
| "voting/voting_unittest.cc", |
| "worker_watcher_unittest.cc", |
| ] |
| |
| deps = [ |
| ":performance_manager", |
| "test_support", |
| "test_support:test_support_common", |
| "//base/test:test_support", |
| "//components/input", |
| "//components/memory_pressure:test_support", |
| "//components/performance_manager/scenario_api", |
| "//components/prefs:test_support", |
| "//components/services/storage/public/cpp", |
| "//components/ukm:test_support", |
| "//content/test:test_support", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| |
| if (is_ios) { |
| deps += [ "//components/test:performance_manager_test_bundle_data" ] |
| } |
| |
| # The site data database isn't supported on Android. |
| if (!is_android) { |
| sources += [ |
| "decorators/site_data_recorder_unittest.cc", |
| "freezing/freezer_unittest.cc", |
| "freezing/freezing_policy_unittest.cc", |
| "freezing/freezing_unittest.cc", |
| "graph/policies/process_priority_policy_unittest.cc", |
| "persistence/site_data/exponential_moving_average_unittest.cc", |
| "persistence/site_data/leveldb_site_data_store_unittest.cc", |
| "persistence/site_data/non_recording_site_data_cache_unittest.cc", |
| "persistence/site_data/site_data_cache_factory_unittest.cc", |
| "persistence/site_data/site_data_cache_impl_unittest.cc", |
| "persistence/site_data/site_data_impl_unittest.cc", |
| "persistence/site_data/site_data_reader_unittest.cc", |
| "persistence/site_data/site_data_writer_unittest.cc", |
| |
| # TODO(crbug.com/40188246): Consider using this policy on Android. |
| "graph/policies/bfcache_policy_unittest.cc", |
| ] |
| } |
| |
| if (is_chromeos) { |
| deps += [ |
| "//chromeos/dbus/power", |
| "//chromeos/dbus/power:power_manager_proto", |
| ] |
| |
| sources += [ "power/battery_level_provider_chromeos_unittest.cc" ] |
| } |
| |
| # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and |
| # enable the diagnostic by removing this line. |
| configs += [ "//build/config/compiler:no_exit_time_destructors" ] |
| } |
| |
| source_set("browser_tests") { |
| testonly = true |
| |
| defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
| |
| sources = [ |
| "freezing/freezing_browsertest.cc", |
| "performance_manager_browsertest.cc", |
| "prerendering_browsertest.cc", |
| "render_process_host_proxy_browsertest.cc", |
| "resource_attribution/memory_measurement_provider_browsertest.cc", |
| "v8_memory/v8_context_tracker_browsertest.cc", |
| ] |
| |
| deps = [ |
| ":performance_manager", |
| "test_support:browsertest_support", |
| "test_support:test_support_common", |
| "//base/test:test_support", |
| "//content/shell:content_shell_lib", |
| "//content/test:browsertest_support", |
| "//content/test:test_support", |
| "//net:test_support", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| |
| if (is_ios) { |
| deps += [ "//components/test:performance_manager_test_bundle_data" ] |
| } |
| } |