summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/scheduler/BUILD.gn
blob: 1c1b853008a2c586a7dc854e196a84553fff3a66 (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
# Copyright 2017 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("//build/config/jumbo.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/blink/renderer/platform/platform.gni")
import("//third_party/protobuf/proto_library.gni")

blink_platform_sources("scheduler") {
  configs += [ "//build/config/compiler:noshadowing" ]

  sources = [
    "common/cancelable_closure_holder.cc",
    "common/cancelable_closure_holder.h",
    "common/cooperative_scheduling_manager.cc",
    "common/dummy_schedulers.cc",
    "common/event_loop.cc",
    "common/features.cc",
    "common/features.h",
    "common/frame_or_worker_scheduler.cc",
    "common/idle_helper.cc",
    "common/idle_helper.h",
    "common/metrics_helper.cc",
    "common/metrics_helper.h",
    "common/pollable_thread_safe_flag.cc",
    "common/pollable_thread_safe_flag.h",
    "common/post_cancellable_task.cc",
    "common/process_state.cc",
    "common/process_state.h",
    "common/scheduler_helper.cc",
    "common/scheduler_helper.h",
    "common/scheduling_lifecycle_state.cc",
    "common/simple_thread_scheduler.cc",
    "common/simple_thread_scheduler.h",
    "common/single_thread_idle_task_runner.cc",
    "common/single_thread_idle_task_runner.h",
    "common/thread.cc",
    "common/thread_cpu_throttler.cc",
    "common/thread_load_tracker.cc",
    "common/thread_load_tracker.h",
    "common/thread_scheduler.cc",
    "common/thread_scheduler_impl.h",
    "common/thread_type.cc",
    "common/throttling/budget_pool.cc",
    "common/throttling/budget_pool.h",
    "common/throttling/budget_pool_controller.h",
    "common/throttling/cpu_time_budget_pool.cc",
    "common/throttling/cpu_time_budget_pool.h",
    "common/throttling/task_queue_throttler.cc",
    "common/throttling/task_queue_throttler.h",
    "common/throttling/throttled_time_domain.cc",
    "common/throttling/throttled_time_domain.h",
    "common/throttling/wake_up_budget_pool.cc",
    "common/throttling/wake_up_budget_pool.h",
    "common/tracing_helper.cc",
    "common/tracing_helper.h",
    "common/ukm_task_sampler.cc",
    "common/ukm_task_sampler.h",
    "common/unprioritized_resource_loading_task_runner_handle.cc",
    "common/unprioritized_resource_loading_task_runner_handle.h",
    "common/web_resource_loading_task_runner_handle.cc",
    "common/web_thread_scheduler.cc",
    "common/worker_pool.cc",
    "main_thread/agent_group_scheduler_impl.cc",
    "main_thread/agent_group_scheduler_impl.h",
    "main_thread/agent_scheduling_strategy.cc",
    "main_thread/agent_scheduling_strategy.h",
    "main_thread/attribution_group.h",
    "main_thread/auto_advancing_virtual_time_domain.cc",
    "main_thread/auto_advancing_virtual_time_domain.h",
    "main_thread/compositor_priority_experiments.cc",
    "main_thread/compositor_priority_experiments.h",
    "main_thread/deadline_task_runner.cc",
    "main_thread/deadline_task_runner.h",
    "main_thread/find_in_page_budget_pool_controller.cc",
    "main_thread/find_in_page_budget_pool_controller.h",
    "main_thread/frame_origin_type.cc",
    "main_thread/frame_origin_type.h",
    "main_thread/frame_scheduler_impl.cc",
    "main_thread/frame_scheduler_impl.h",
    "main_thread/frame_status.cc",
    "main_thread/frame_task_queue_controller.cc",
    "main_thread/frame_task_queue_controller.h",
    "main_thread/idle_time_estimator.cc",
    "main_thread/idle_time_estimator.h",
    "main_thread/main_thread.cc",
    "main_thread/main_thread.h",
    "main_thread/main_thread_metrics_helper.cc",
    "main_thread/main_thread_metrics_helper.h",
    "main_thread/main_thread_scheduler_helper.cc",
    "main_thread/main_thread_scheduler_helper.h",
    "main_thread/main_thread_scheduler_impl.cc",
    "main_thread/main_thread_scheduler_impl.h",
    "main_thread/main_thread_task_queue.cc",
    "main_thread/main_thread_task_queue.h",
    "main_thread/memory_purge_manager.cc",
    "main_thread/memory_purge_manager.h",
    "main_thread/non_waking_time_domain.cc",
    "main_thread/non_waking_time_domain.h",
    "main_thread/page_scheduler_impl.cc",
    "main_thread/page_scheduler_impl.h",
    "main_thread/page_visibility_state.cc",
    "main_thread/page_visibility_state.h",
    "main_thread/pending_user_input.cc",
    "main_thread/pending_user_input.h",
    "main_thread/render_widget_signals.cc",
    "main_thread/render_widget_signals.h",
    "main_thread/resource_loading_task_runner_handle_impl.cc",
    "main_thread/resource_loading_task_runner_handle_impl.h",
    "main_thread/task_type_names.cc",
    "main_thread/task_type_names.h",
    "main_thread/use_case.h",
    "main_thread/user_model.cc",
    "main_thread/user_model.h",
    "main_thread/web_render_widget_scheduling_state.cc",
    "main_thread/web_scheduling_priority.cc",
    "main_thread/web_scheduling_task_queue_impl.cc",
    "main_thread/web_scheduling_task_queue_impl.h",
    "main_thread/web_scoped_virtual_time_pauser.cc",
    "main_thread/widget_scheduler.cc",
    "main_thread/widget_scheduler.h",
    "public/agent_group_scheduler.h",
    "public/aggregated_metric_reporter.h",
    "public/cooperative_scheduling_manager.h",
    "public/dummy_schedulers.h",
    "public/event_loop.h",
    "public/frame_or_worker_scheduler.h",
    "public/frame_scheduler.h",
    "public/frame_status.h",
    "public/page_lifecycle_state.h",
    "public/page_scheduler.h",
    "public/post_cancellable_task.h",
    "public/post_cross_thread_task.h",
    "public/rail_mode_observer.h",
    "public/scheduling_lifecycle_state.h",
    "public/scheduling_policy.h",
    "public/thread.h",
    "public/thread_cpu_throttler.h",
    "public/thread_scheduler.h",
    "public/thread_type.h",
    "public/web_scheduling_priority.h",
    "public/web_scheduling_task_queue.h",
    "public/worker_pool.h",
    "public/worker_scheduler.h",
    "worker/compositor_metrics_helper.cc",
    "worker/compositor_metrics_helper.h",
    "worker/compositor_thread.cc",
    "worker/compositor_thread.h",
    "worker/compositor_thread_scheduler.cc",
    "worker/compositor_thread_scheduler.h",
    "worker/non_main_thread_scheduler_helper.cc",
    "worker/non_main_thread_scheduler_helper.h",
    "worker/non_main_thread_scheduler_impl.cc",
    "worker/non_main_thread_scheduler_impl.h",
    "worker/non_main_thread_task_queue.cc",
    "worker/non_main_thread_task_queue.h",
    "worker/worker_metrics_helper.cc",
    "worker/worker_metrics_helper.h",
    "worker/worker_scheduler.cc",
    "worker/worker_scheduler_proxy.cc",
    "worker/worker_scheduler_proxy.h",
    "worker/worker_thread.cc",
    "worker/worker_thread.h",
    "worker/worker_thread_scheduler.cc",
    "worker/worker_thread_scheduler.h",
  ]

  deps = [
    "//base",
    "//cc",
    "//components/power_scheduler",
    "//components/scheduling_metrics",
    "//device/base/synchronization",
    "//services/metrics/public/cpp:ukm_builders",
    "//services/metrics/public/mojom",
    "//third_party/blink/renderer/platform:make_platform_generated",
    "//third_party/blink/renderer/platform/heap:heap",
    "//third_party/blink/renderer/platform/instrumentation",
    "//third_party/blink/renderer/platform/wtf",
    "//v8",
  ]

  allow_circular_includes_from = [
    "//third_party/blink/renderer/platform/heap:heap",
    "//third_party/blink/renderer/platform/instrumentation",
  ]
}

jumbo_source_set("test_support") {
  testonly = true

  sources = [
    "test/fake_agent_group_scheduler_scheduler.h",
    "test/fake_frame_scheduler.h",
    "test/fake_page_scheduler.h",
    "test/fake_task_runner.cc",
    "test/fake_task_runner.h",
    "test/recording_task_time_observer.cc",
    "test/recording_task_time_observer.h",
    "test/renderer_scheduler_test_support.cc",
    "test/web_fake_thread_scheduler.cc",
    "test/web_fake_widget_scheduler.cc",
    "test/web_fake_widget_scheduler.h",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//mojo/public/cpp/bindings",
    "//skia",
    "//testing/gmock",
    "//third_party/blink/public:test_headers",
    "//third_party/blink/public/mojom:mojom_platform_blink_headers",
    "//third_party/blink/renderer/platform:platform",
  ]

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

jumbo_source_set("unit_tests") {
  testonly = true

  sources = [
    "common/cooperative_scheduling_manager_unittest.cc",
    "common/idle_helper_unittest.cc",
    "common/metrics_helper_unittest.cc",
    "common/post_cancellable_task_unittest.cc",
    "common/scheduler_helper_unittest.cc",
    "common/thread_load_tracker_unittest.cc",
    "common/thread_unittest.cc",
    "common/throttling/budget_pool_unittest.cc",
    "common/throttling/task_queue_throttler_unittest.cc",
    "common/tracing_helper_unittest.cc",
    "common/ukm_task_sampler_unittest.cc",
    "common/worker_pool_unittest.cc",
    "main_thread/agent_scheduling_strategy_unittest.cc",
    "main_thread/auto_advancing_virtual_time_domain_unittest.cc",
    "main_thread/deadline_task_runner_unittest.cc",
    "main_thread/frame_scheduler_impl_unittest.cc",
    "main_thread/frame_task_queue_controller_unittest.cc",
    "main_thread/idle_time_estimator_unittest.cc",
    "main_thread/main_thread_metrics_helper_unittest.cc",
    "main_thread/main_thread_perftest.cc",
    "main_thread/main_thread_scheduler_impl_unittest.cc",
    "main_thread/main_thread_unittest.cc",
    "main_thread/memory_purge_manager_unittest.cc",
    "main_thread/page_scheduler_impl_unittest.cc",
    "main_thread/pending_user_input_unittest.cc",
    "main_thread/render_widget_signals_unittest.cc",
    "main_thread/user_model_unittest.cc",
    "worker/worker_scheduler_proxy_unittest.cc",
    "worker/worker_scheduler_unittest.cc",
    "worker/worker_thread_scheduler_unittest.cc",
    "worker/worker_thread_unittest.cc",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//components/ukm:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/blink/public:test_support",
    "//third_party/googletest:gmock",
  ]

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

jumbo_source_set("scheduler_fuzzer_tests") {
  testonly = true

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

  if (is_linux || is_chromeos) {
    sources += [
      "test/fuzzer/sequence_manager_fuzzer_processor.cc",
      "test/fuzzer/sequence_manager_fuzzer_processor.h",
      "test/fuzzer/sequence_manager_fuzzer_processor_unittest.cc",
      "test/fuzzer/simple_thread_impl.cc",
      "test/fuzzer/simple_thread_impl.h",
      "test/fuzzer/task_queue_with_voters.h",
      "test/fuzzer/thread_manager.cc",
      "test/fuzzer/thread_manager.h",
      "test/fuzzer/thread_pool_manager.cc",
      "test/fuzzer/thread_pool_manager.h",
    ]

    deps += [
      ":sequence_manager_test_description_proto",
      "//third_party/blink/renderer/platform:platform",
      "//third_party/libprotobuf-mutator",
    ]
  }

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

fuzzer_test("sequence_manager_fuzzer") {
  sources = [
    "test/fuzzer/sequence_manager_fuzzer.cc",
    "test/fuzzer/sequence_manager_fuzzer_processor.cc",
    "test/fuzzer/sequence_manager_fuzzer_processor.h",
    "test/fuzzer/simple_thread_impl.cc",
    "test/fuzzer/simple_thread_impl.h",
    "test/fuzzer/task_queue_with_voters.h",
    "test/fuzzer/thread_manager.cc",
    "test/fuzzer/thread_manager.h",
    "test/fuzzer/thread_pool_manager.cc",
    "test/fuzzer/thread_pool_manager.h",
  ]

  deps = [
    ":sequence_manager_test_description_proto",
    "//base/test:test_support",
    "//third_party/blink/renderer/platform:blink_fuzzer_test_support",
    "//third_party/blink/renderer/platform:platform",
    "//third_party/blink/renderer/platform:test_support",
    "//third_party/libprotobuf-mutator",
  ]
}

proto_library("sequence_manager_test_description_proto") {
  sources = [ "test/fuzzer/proto/sequence_manager_test_description.proto" ]
}