BUILD.gn 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. # Copyright 2019 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//third_party/protobuf/proto_library.gni")
  5. proto_library("site_data_proto") {
  6. sources = [ "persistence/site_data/site_data.proto" ]
  7. }
  8. static_library("performance_manager") {
  9. sources = [
  10. "binders.cc",
  11. "decorators/frame_visibility_decorator.cc",
  12. "decorators/frame_visibility_decorator.h",
  13. "decorators/freezing_vote_decorator.cc",
  14. "decorators/freezing_vote_decorator.h",
  15. "decorators/page_live_state_decorator.cc",
  16. "decorators/page_load_tracker_decorator.cc",
  17. "decorators/page_load_tracker_decorator.h",
  18. "decorators/page_load_tracker_decorator_helper.cc",
  19. "decorators/process_hosted_content_types_aggregator.cc",
  20. "decorators/process_hosted_content_types_aggregator.h",
  21. "decorators/process_metrics_decorator.cc",
  22. "embedder/binders.h",
  23. "embedder/graph_features.h",
  24. "embedder/performance_manager_lifetime.h",
  25. "embedder/performance_manager_registry.h",
  26. "execution_context/execution_context_impl.cc",
  27. "execution_context/execution_context_impl.h",
  28. "execution_context/execution_context_registry_impl.cc",
  29. "execution_context/execution_context_registry_impl.h",
  30. "execution_context_priority/ad_frame_voter.cc",
  31. "execution_context_priority/ad_frame_voter.h",
  32. "execution_context_priority/boosting_vote_aggregator.cc",
  33. "execution_context_priority/boosting_vote_aggregator.h",
  34. "execution_context_priority/execution_context_priority.cc",
  35. "execution_context_priority/execution_context_priority_decorator.cc",
  36. "execution_context_priority/execution_context_priority_decorator.h",
  37. "execution_context_priority/frame_audible_voter.cc",
  38. "execution_context_priority/frame_audible_voter.h",
  39. "execution_context_priority/frame_visibility_voter.cc",
  40. "execution_context_priority/frame_visibility_voter.h",
  41. "execution_context_priority/inherit_client_priority_voter.cc",
  42. "execution_context_priority/inherit_client_priority_voter.h",
  43. "execution_context_priority/max_vote_aggregator.cc",
  44. "execution_context_priority/max_vote_aggregator.h",
  45. "execution_context_priority/override_vote_aggregator.cc",
  46. "execution_context_priority/override_vote_aggregator.h",
  47. "execution_context_priority/root_vote_observer.cc",
  48. "execution_context_priority/root_vote_observer.h",
  49. "features.cc",
  50. "freezing/freezing.cc",
  51. "freezing/freezing_vote_aggregator.cc",
  52. "freezing/freezing_vote_aggregator.h",
  53. "graph/frame_node.cc",
  54. "graph/frame_node_impl.cc",
  55. "graph/frame_node_impl.h",
  56. "graph/frame_node_impl_describer.cc",
  57. "graph/frame_node_impl_describer.h",
  58. "graph/graph.cc",
  59. "graph/graph_impl.cc",
  60. "graph/graph_impl.h",
  61. "graph/graph_impl_operations.cc",
  62. "graph/graph_impl_operations.h",
  63. "graph/graph_impl_util.h",
  64. "graph/graph_operations.cc",
  65. "graph/graph_registered.cc",
  66. "graph/node.cc",
  67. "graph/node_attached_data.cc",
  68. "graph/node_attached_data.h",
  69. "graph/node_attached_data_impl.h",
  70. "graph/node_base.cc",
  71. "graph/node_base.h",
  72. "graph/node_data_describer.cc",
  73. "graph/node_type.h",
  74. "graph/page_node.cc",
  75. "graph/page_node_impl.cc",
  76. "graph/page_node_impl.h",
  77. "graph/page_node_impl_describer.cc",
  78. "graph/page_node_impl_describer.h",
  79. "graph/policies/process_priority_policy.cc",
  80. "graph/policies/process_priority_policy.h",
  81. "graph/process_node.cc",
  82. "graph/process_node_impl.cc",
  83. "graph/process_node_impl.h",
  84. "graph/process_node_impl_describer.cc",
  85. "graph/process_node_impl_describer.h",
  86. "graph/properties.h",
  87. "graph/system_node.cc",
  88. "graph/system_node_impl.cc",
  89. "graph/system_node_impl.h",
  90. "graph/worker_node.cc",
  91. "graph/worker_node_impl.cc",
  92. "graph/worker_node_impl.h",
  93. "graph/worker_node_impl_describer.cc",
  94. "graph/worker_node_impl_describer.h",
  95. "graph_features.cc",
  96. "metrics/metrics_collector.cc",
  97. "owned_objects.h",
  98. "performance_manager.cc",
  99. "performance_manager_feature_observer_client.cc",
  100. "performance_manager_feature_observer_client.h",
  101. "performance_manager_impl.cc",
  102. "performance_manager_impl.h",
  103. "performance_manager_lifetime.cc",
  104. "performance_manager_registry.cc",
  105. "performance_manager_registry_impl.cc",
  106. "performance_manager_registry_impl.h",
  107. "performance_manager_tab_helper.cc",
  108. "performance_manager_tab_helper.h",
  109. "process_node_source.cc",
  110. "process_node_source.h",
  111. "public/decorators/page_live_state_decorator.h",
  112. "public/decorators/page_load_tracker_decorator_helper.h",
  113. "public/decorators/process_metrics_decorator.h",
  114. "public/execution_context/execution_context.h",
  115. "public/execution_context/execution_context_attached_data.h",
  116. "public/execution_context/execution_context_registry.h",
  117. "public/execution_context_priority/execution_context_priority.h",
  118. "public/features.h",
  119. "public/freezing/freezing.h",
  120. "public/graph/frame_node.h",
  121. "public/graph/graph.h",
  122. "public/graph/graph_operations.h",
  123. "public/graph/graph_registered.h",
  124. "public/graph/node.h",
  125. "public/graph/node_attached_data.h",
  126. "public/graph/node_data_describer.h",
  127. "public/graph/node_data_describer_registry.h",
  128. "public/graph/node_data_describer_util.cc",
  129. "public/graph/node_data_describer_util.h",
  130. "public/graph/node_state.h",
  131. "public/graph/page_node.h",
  132. "public/graph/policies/background_tab_loading_policy.h",
  133. "public/graph/process_node.h",
  134. "public/graph/system_node.h",
  135. "public/graph/worker_node.h",
  136. "public/metrics/background_metrics_reporter.h",
  137. "public/metrics/metrics_collector.h",
  138. "public/performance_manager.h",
  139. "public/performance_manager_main_thread_mechanism.h",
  140. "public/performance_manager_main_thread_observer.h",
  141. "public/performance_manager_owned.h",
  142. "public/performance_manager_registered.h",
  143. "public/render_frame_host_proxy.h",
  144. "public/render_process_host_id.h",
  145. "public/render_process_host_proxy.h",
  146. "public/user_tuning/prefs.h",
  147. "public/v8_memory/v8_detailed_memory.h",
  148. "public/v8_memory/v8_detailed_memory_any_seq.h",
  149. "public/v8_memory/web_memory.h",
  150. "public/voting/voting.h",
  151. "public/web_contents_proxy.h",
  152. "registered_objects.h",
  153. "render_frame_host_proxy.cc",
  154. "render_process_host_proxy.cc",
  155. "render_process_user_data.cc",
  156. "render_process_user_data.h",
  157. "service_worker_client.cc",
  158. "service_worker_client.h",
  159. "service_worker_context_adapter.cc",
  160. "service_worker_context_adapter.h",
  161. "tab_helper_frame_node_source.cc",
  162. "tab_helper_frame_node_source.h",
  163. "user_tuning/prefs.cc",
  164. "v8_memory/v8_context_tracker.cc",
  165. "v8_memory/v8_context_tracker.h",
  166. "v8_memory/v8_context_tracker_helpers.cc",
  167. "v8_memory/v8_context_tracker_helpers.h",
  168. "v8_memory/v8_context_tracker_internal.cc",
  169. "v8_memory/v8_context_tracker_internal.h",
  170. "v8_memory/v8_detailed_memory.cc",
  171. "v8_memory/v8_detailed_memory_any_seq.cc",
  172. "v8_memory/v8_detailed_memory_decorator.cc",
  173. "v8_memory/v8_detailed_memory_decorator.h",
  174. "v8_memory/web_memory_aggregator.cc",
  175. "v8_memory/web_memory_aggregator.h",
  176. "v8_memory/web_memory_impl.cc",
  177. "v8_memory/web_memory_impl.h",
  178. "v8_memory/web_memory_stress_tester.cc",
  179. "v8_memory/web_memory_stress_tester.h",
  180. "web_contents_proxy.cc",
  181. "web_contents_proxy_impl.cc",
  182. "web_contents_proxy_impl.h",
  183. "worker_watcher.cc",
  184. "worker_watcher.h",
  185. ]
  186. deps = [
  187. "//build:chromeos_buildflags",
  188. "//components/metrics",
  189. "//components/pref_registry:pref_registry",
  190. "//components/prefs:prefs",
  191. "//third_party/blink/public/common:headers",
  192. ]
  193. public_deps = [
  194. "//base",
  195. "//base/allocator:buildflags",
  196. "//components/performance_manager/public/mojom",
  197. "//content/public/browser",
  198. "//services/metrics/public/cpp:metrics_cpp",
  199. "//services/metrics/public/cpp:ukm_builders",
  200. "//third_party/blink/public/common",
  201. "//url",
  202. ]
  203. if (!is_android) {
  204. sources += [
  205. "decorators/site_data_recorder.cc",
  206. "persistence/site_data/exponential_moving_average.cc",
  207. "persistence/site_data/exponential_moving_average.h",
  208. "persistence/site_data/leveldb_site_data_store.cc",
  209. "persistence/site_data/leveldb_site_data_store.h",
  210. "persistence/site_data/non_recording_site_data_cache.cc",
  211. "persistence/site_data/non_recording_site_data_cache.h",
  212. "persistence/site_data/noop_site_data_writer.cc",
  213. "persistence/site_data/noop_site_data_writer.h",
  214. "persistence/site_data/site_data_cache.h",
  215. "persistence/site_data/site_data_cache_factory.cc",
  216. "persistence/site_data/site_data_cache_factory.h",
  217. "persistence/site_data/site_data_cache_impl.cc",
  218. "persistence/site_data/site_data_cache_impl.h",
  219. "persistence/site_data/site_data_cache_inspector.h",
  220. "persistence/site_data/site_data_impl.cc",
  221. "persistence/site_data/site_data_impl.h",
  222. "persistence/site_data/site_data_reader.cc",
  223. "persistence/site_data/site_data_store.h",
  224. "persistence/site_data/site_data_writer.cc",
  225. "persistence/site_data/site_data_writer.h",
  226. "persistence/site_data/tab_visibility.h",
  227. "public/decorators/site_data_recorder.h",
  228. "public/persistence/site_data/feature_usage.h",
  229. "public/persistence/site_data/site_data_reader.h",
  230. # TODO(crbug.com/1225070): Consider using this policy on Android.
  231. "graph/policies/bfcache_policy.cc",
  232. "graph/policies/bfcache_policy.h",
  233. ]
  234. public_deps += [
  235. ":site_data_proto",
  236. "//third_party/leveldatabase",
  237. ]
  238. }
  239. }
  240. source_set("unit_tests") {
  241. testonly = true
  242. sources = [
  243. "decorators/decorators_utils_unittest.cc",
  244. "decorators/frame_visibility_decorator_unittest.cc",
  245. "decorators/freezing_vote_decorator_unittest.cc",
  246. "decorators/page_live_state_decorator_unittest.cc",
  247. "decorators/page_load_tracker_decorator_unittest.cc",
  248. "decorators/process_hosted_content_types_aggregator_unittest.cc",
  249. "execution_context/execution_context_attached_data_unittest.cc",
  250. "execution_context/execution_context_registry_impl_unittest.cc",
  251. "execution_context_priority/ad_frame_voter_unittest.cc",
  252. "execution_context_priority/boosting_vote_aggregator_unittest.cc",
  253. "execution_context_priority/execution_context_priority_unittest.cc",
  254. "execution_context_priority/frame_audible_voter_unittest.cc",
  255. "execution_context_priority/frame_visibility_voter_unittest.cc",
  256. "execution_context_priority/inherit_client_priority_voter_unittest.cc",
  257. "execution_context_priority/max_vote_aggregator_unittest.cc",
  258. "execution_context_priority/override_vote_aggregator_unittest.cc",
  259. "execution_context_priority/root_vote_observer_unittest.cc",
  260. "freezing/freezing_vote_aggregator_unittest.cc",
  261. "graph/frame_node_impl_unittest.cc",
  262. "graph/graph_impl_operations_unittest.cc",
  263. "graph/graph_impl_unittest.cc",
  264. "graph/graph_operations_unittest.cc",
  265. "graph/graph_registered_unittest.cc",
  266. "graph/node_attached_data_unittest.cc",
  267. "graph/node_base_unittest.cc",
  268. "graph/page_node_impl_unittest.cc",
  269. "graph/policies/process_priority_policy_unittest.cc",
  270. "graph/process_node_impl_unittest.cc",
  271. "graph/properties_unittest.cc",
  272. "graph/system_node_impl_unittest.cc",
  273. "graph/worker_node_impl_unittest.cc",
  274. "graph_features_unittest.cc",
  275. "metrics/metrics_collector_unittest.cc",
  276. "owned_objects_unittest.cc",
  277. "performance_manager_impl_unittest.cc",
  278. "performance_manager_registry_impl_unittest.cc",
  279. "performance_manager_tab_helper_unittest.cc",
  280. "performance_manager_unittest.cc",
  281. "registered_objects_unittest.cc",
  282. "render_process_host_id_unittest.cc",
  283. "v8_memory/v8_context_tracker_helpers_unittest.cc",
  284. "v8_memory/v8_context_tracker_internal_unittest.cc",
  285. "v8_memory/v8_context_tracker_unittest.cc",
  286. "v8_memory/v8_detailed_memory_unittest.cc",
  287. "v8_memory/v8_memory_test_helpers.cc",
  288. "v8_memory/v8_memory_test_helpers.h",
  289. "v8_memory/web_memory_aggregator_unittest.cc",
  290. "v8_memory/web_memory_impl_unittest.cc",
  291. "voting_unittest.cc",
  292. "web_contents_proxy_unittest.cc",
  293. "worker_watcher_unittest.cc",
  294. ]
  295. deps = [
  296. ":performance_manager",
  297. "test_support:test_support",
  298. "test_support:test_support_common",
  299. "//base/test:test_support",
  300. "//components/memory_pressure:test_support",
  301. "//components/prefs:test_support",
  302. "//components/services/storage/public/cpp",
  303. "//components/ukm:test_support",
  304. "//content/test:test_support",
  305. "//testing/gmock",
  306. "//testing/gtest",
  307. ]
  308. # The site data database isn't supported on Android.
  309. if (!is_android) {
  310. sources += [
  311. "decorators/site_data_recorder_unittest.cc",
  312. "freezing/freezing_unittest.cc",
  313. "persistence/site_data/exponential_moving_average_unittest.cc",
  314. "persistence/site_data/leveldb_site_data_store_unittest.cc",
  315. "persistence/site_data/non_recording_site_data_cache_unittest.cc",
  316. "persistence/site_data/site_data_cache_factory_unittest.cc",
  317. "persistence/site_data/site_data_cache_impl_unittest.cc",
  318. "persistence/site_data/site_data_impl_unittest.cc",
  319. "persistence/site_data/site_data_reader_unittest.cc",
  320. "persistence/site_data/site_data_writer_unittest.cc",
  321. "persistence/site_data/unittest_utils.cc",
  322. "persistence/site_data/unittest_utils.h",
  323. # TODO(crbug.com/1225070): Consider using this policy on Android.
  324. "graph/policies/bfcache_policy_unittest.cc",
  325. ]
  326. }
  327. }
  328. source_set("browser_tests") {
  329. testonly = true
  330. defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
  331. sources = [
  332. "performance_manager_browsertest.cc",
  333. "prerendering_browsertest.cc",
  334. "render_process_host_proxy_browsertest.cc",
  335. "v8_memory/v8_context_tracker_browsertest.cc",
  336. ]
  337. deps = [
  338. ":performance_manager",
  339. "test_support:browsertest_support",
  340. "test_support:test_support_common",
  341. "//base/test:test_support",
  342. "//content/shell:content_shell_lib",
  343. "//content/test:browsertest_support",
  344. "//content/test:test_support",
  345. "//net:test_support",
  346. "//testing/gmock",
  347. "//testing/gtest",
  348. ]
  349. }