summaryrefslogtreecommitdiff
path: root/chromium/components/performance_manager/BUILD.gn
blob: a13b9c754728bb0daf1c6996e24bc98b617a8248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# Copyright 2019 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("//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",
    "decorators/frame_visibility_decorator.cc",
    "decorators/frame_visibility_decorator.h",
    "decorators/freezing_vote_decorator.cc",
    "decorators/freezing_vote_decorator.h",
    "decorators/page_live_state_decorator.cc",
    "decorators/page_load_tracker_decorator.cc",
    "decorators/page_load_tracker_decorator.h",
    "decorators/page_load_tracker_decorator_helper.cc",
    "decorators/process_metrics_decorator.cc",
    "decorators/tab_properties_decorator.cc",
    "embedder/binders.h",
    "embedder/graph_features_helper.h",
    "embedder/performance_manager_lifetime.h",
    "embedder/performance_manager_registry.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/ad_frame_voter.cc",
    "execution_context_priority/ad_frame_voter.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/execution_context_priority_decorator.cc",
    "execution_context_priority/execution_context_priority_decorator.h",
    "execution_context_priority/frame_audible_voter.cc",
    "execution_context_priority/frame_audible_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/max_vote_aggregator.cc",
    "execution_context_priority/max_vote_aggregator.h",
    "execution_context_priority/override_vote_aggregator.cc",
    "execution_context_priority/override_vote_aggregator.h",
    "execution_context_priority/root_vote_observer.cc",
    "execution_context_priority/root_vote_observer.h",
    "features.cc",
    "freezing/freezing.cc",
    "freezing/freezing_vote_aggregator.cc",
    "freezing/freezing_vote_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.h",
    "graph/node_attached_data_impl.h",
    "graph/node_base.cc",
    "graph/node_base.h",
    "graph/node_data_describer.cc",
    "graph/node_type.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/process_priority_policy.cc",
    "graph/policies/process_priority_policy.h",
    "graph/policies/tab_loading_frame_navigation_policy.cc",
    "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_helper.cc",
    "mechanisms/tab_loading_frame_navigation_scheduler.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",
    "process_node_source.cc",
    "process_node_source.h",
    "public/decorators/page_live_state_decorator.h",
    "public/decorators/page_load_tracker_decorator_helper.h",
    "public/decorators/process_metrics_decorator.h",
    "public/decorators/tab_properties_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/features.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.cc",
    "public/graph/node_data_describer_util.h",
    "public/graph/node_state.h",
    "public/graph/page_node.h",
    "public/graph/policies/background_tab_loading_policy.h",
    "public/graph/policies/tab_loading_frame_navigation_policy.h",
    "public/graph/process_node.h",
    "public/graph/system_node.h",
    "public/graph/worker_node.h",
    "public/mechanisms/tab_loading_frame_navigation_scheduler.h",
    "public/performance_manager.h",
    "public/performance_manager_main_thread_mechanism.h",
    "public/performance_manager_main_thread_observer.h",
    "public/performance_manager_owned.h",
    "public/performance_manager_registered.h",
    "public/render_frame_host_proxy.h",
    "public/render_process_host_id.h",
    "public/render_process_host_proxy.h",
    "public/v8_memory/v8_detailed_memory.h",
    "public/v8_memory/v8_detailed_memory_any_seq.h",
    "public/v8_memory/web_memory.h",
    "public/voting/voting.h",
    "public/web_contents_proxy.h",
    "registered_objects.h",
    "render_frame_host_proxy.cc",
    "render_process_host_proxy.cc",
    "render_process_user_data.cc",
    "render_process_user_data.h",
    "service_worker_client.cc",
    "service_worker_client.h",
    "service_worker_context_adapter.cc",
    "service_worker_context_adapter.h",
    "tab_helper_frame_node_source.cc",
    "tab_helper_frame_node_source.h",
    "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_any_seq.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",
    "v8_memory/web_memory_stress_tester.cc",
    "v8_memory/web_memory_stress_tester.h",
    "web_contents_proxy.cc",
    "web_contents_proxy_impl.cc",
    "web_contents_proxy_impl.h",
    "worker_watcher.cc",
    "worker_watcher.h",
  ]

  deps = [
    "//build:chromeos_buildflags",
    "//third_party/blink/public/common:headers",
  ]

  public_deps = [
    "//base",
    "//base/allocator:buildflags",
    "//components/performance_manager/public/mojom",
    "//content/public/browser",
    "//services/metrics/public/cpp:metrics_cpp",
    "//third_party/blink/public/common",
    "//url",
  ]

  if (!is_android) {
    sources += [
      "decorators/site_data_recorder.cc",
      "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",
      "public/decorators/site_data_recorder.h",
      "public/persistence/site_data/feature_usage.h",
      "public/persistence/site_data/site_data_reader.h",
    ]

    public_deps += [
      ":site_data_proto",
      "//third_party/leveldatabase",
    ]
  }
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "decorators/decorators_utils_unittest.cc",
    "decorators/frame_visibility_decorator_unittest.cc",
    "decorators/freezing_vote_decorator_unittest.cc",
    "decorators/page_live_state_decorator_unittest.cc",
    "decorators/page_load_tracker_decorator_unittest.cc",
    "decorators/tab_properties_decorator_unittest.cc",
    "execution_context/execution_context_attached_data_unittest.cc",
    "execution_context/execution_context_registry_impl_unittest.cc",
    "execution_context_priority/ad_frame_voter_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_visibility_voter_unittest.cc",
    "execution_context_priority/inherit_client_priority_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/freezing_vote_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/page_node_impl_unittest.cc",
    "graph/policies/process_priority_policy_unittest.cc",
    "graph/policies/tab_loading_frame_navigation_policy_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_helper_unittest.cc",
    "mechanisms/tab_loading_frame_navigation_scheduler_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",
    "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_unittest.cc",
    "web_contents_proxy_unittest.cc",
    "worker_watcher_unittest.cc",
  ]

  deps = [
    ":performance_manager",
    "test_support:test_support",
    "test_support:test_support_common",
    "//base/test:test_support",
    "//base/util/memory_pressure:test_support",
    "//components/services/storage/public/cpp",
    "//content/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]

  # The site data database isn't supported on Android.
  if (!is_android) {
    sources += [
      "decorators/site_data_recorder_unittest.cc",
      "freezing/freezing_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",
      "persistence/site_data/unittest_utils.cc",
      "persistence/site_data/unittest_utils.h",
    ]
  }
}

source_set("browser_tests") {
  testonly = true

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  sources = [
    "mechanisms/tab_loading_frame_navigation_scheduler_browsertest.cc",
    "performance_manager_browsertest.cc",
    "render_process_host_proxy_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",
  ]
}