blob: 2e72dd644dd8b51e91a5911b12ec43c2b1242313 [file] [log] [blame]
Danil Chapovalov959e9b62019-01-14 13:29:181# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../webrtc.gni")
10
Mirko Bonadei86d053c2019-10-17 19:32:0411rtc_library("task_queue") {
Danil Chapovalov959e9b62019-01-14 13:29:1812 visibility = [ "*" ]
13 public = [
Danil Chapovalov348b08a2019-01-17 12:07:2514 "task_queue_base.h",
15 "task_queue_factory.h",
16 ]
Mirko Bonadeiccbe95f2020-01-21 11:10:1017 sources = [ "task_queue_base.cc" ]
Danil Chapovalov348b08a2019-01-17 12:07:2518
19 deps = [
Markus Handell2a256c82023-02-27 11:41:3920 "..:location",
Danil Chapovalovb4c6d1e2019-01-21 12:52:5921 "../../rtc_base:checks",
Danil Chapovalov4423c362019-03-06 17:41:3922 "../../rtc_base:macromagic",
Mirko Bonadeid4002a72019-11-12 19:11:4823 "../../rtc_base/system:rtc_export",
Danil Chapovalov8feb6fd2022-07-05 09:01:2724 "../units:time_delta",
Danil Chapovalov47cf5ea2019-02-19 19:20:1625 "//third_party/abseil-cpp/absl/base:config",
Danil Chapovalov348b08a2019-01-17 12:07:2526 "//third_party/abseil-cpp/absl/base:core_headers",
Danil Chapovalov8feb6fd2022-07-05 09:01:2727 "//third_party/abseil-cpp/absl/functional:any_invocable",
Florent Castelli99c519b2024-05-23 11:21:5328 "//third_party/abseil-cpp/absl/strings:string_view",
Danil Chapovalov959e9b62019-01-14 13:29:1829 ]
30}
Danil Chapovalovbaaf9112019-01-18 09:09:4031
Mirko Bonadei86d053c2019-10-17 19:32:0432rtc_library("task_queue_test") {
Danil Chapovalov33b716f2019-01-22 17:15:3733 visibility = [ "*" ]
34 testonly = true
35 sources = [
36 "task_queue_test.cc",
37 "task_queue_test.h",
38 ]
Mirko Bonadeic04792e2019-10-22 21:57:0339
40 check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/9419)
41 if (build_with_chromium) {
Mirko Bonadei92dd35d2019-11-15 15:08:4142 visibility = []
43 visibility = webrtc_default_visibility
44 visibility += [
Markus Handellf76a8232022-09-19 14:47:4845 # This is the only Chromium targets that can depend on this. The reason
46 # behind this is the fact that these are 'testonly' targets and as such
Mirko Bonadei92dd35d2019-11-15 15:08:4147 # it cannot be part of the WebRTC component.
Markus Handellf76a8232022-09-19 14:47:4848 "//components/webrtc:unit_tests",
Mirko Bonadei92dd35d2019-11-15 15:08:4149 "//third_party/blink/renderer/platform:blink_platform_unittests_sources",
50 ]
51
Mirko Bonadeic04792e2019-10-22 21:57:0352 # Don't depend on WebRTC code outside of webrtc_overrides:webrtc_component
53 # because this will break the WebRTC component build in Chromium.
54 deps = [
55 "../../../webrtc_overrides:webrtc_component",
56 "../../test:test_support",
Danil Chapovalov8feb6fd2022-07-05 09:01:2757 "//third_party/abseil-cpp/absl/cleanup",
Mirko Bonadeic04792e2019-10-22 21:57:0358 "//third_party/abseil-cpp/absl/strings",
59 ]
60 } else {
61 deps = [
Ali Tofigh4b681942022-08-23 10:57:1662 ":default_task_queue_factory",
Mirko Bonadeic04792e2019-10-22 21:57:0363 ":task_queue",
Ali Tofigh4b681942022-08-23 10:57:1664 "../../api:field_trials_view",
Markus Handell82da9322022-12-16 14:50:2465 "../../api:make_ref_counted",
Mirko Bonadeia8dd3a32024-08-06 15:49:3366 "../../api:ref_count",
Danil Chapovalov8feb6fd2022-07-05 09:01:2767 "../../api/units:time_delta",
Mirko Bonadeic04792e2019-10-22 21:57:0368 "../../rtc_base:refcount",
69 "../../rtc_base:rtc_event",
70 "../../rtc_base:timeutils",
Mirko Bonadeic04792e2019-10-22 21:57:0371 "../../test:test_support",
Danil Chapovalov8feb6fd2022-07-05 09:01:2772 "//third_party/abseil-cpp/absl/cleanup",
Mirko Bonadeic04792e2019-10-22 21:57:0373 "//third_party/abseil-cpp/absl/strings",
74 ]
75 }
Danil Chapovalov33b716f2019-01-22 17:15:3776}
77
Mirko Bonadei86d053c2019-10-17 19:32:0478rtc_library("default_task_queue_factory") {
Danil Chapovalov2684ab32019-02-26 09:18:0879 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 10:44:4380 if (!is_ios && !is_android) {
Danil Chapovalov9fdceb82023-11-27 09:57:2281 # Internally webrtc shouldn't rely on any specific TaskQueue implementation
82 # and should create TaskQueue using TaskQueueFactory interface.
83 # TaskQueueFactory interface can be propagated with Environment.
84 poisonous = [ "environment_construction" ]
Danil Chapovalov41300af2019-07-10 10:44:4385 }
Mirko Bonadeiccbe95f2020-01-21 11:10:1086 sources = [ "default_task_queue_factory.h" ]
Ali Tofigh4b681942022-08-23 10:57:1687 deps = [
88 ":task_queue",
89 "../../api:field_trials_view",
90 "../../rtc_base/memory:always_valid_pointer",
91 ]
Danil Chapovalov87ce8742019-02-01 18:40:1192
Mirko Bonadeia9cfa472019-02-24 09:17:2193 if (rtc_enable_libevent) {
Ali Tofigh4b681942022-08-23 10:57:1694 if (is_android) {
95 sources +=
96 [ "default_task_queue_factory_stdlib_or_libevent_experiment.cc" ]
97 deps += [
98 "../../api/transport:field_trial_based_config",
99 "../../rtc_base:logging",
100 "../../rtc_base:rtc_task_queue_libevent",
101 "../../rtc_base:rtc_task_queue_stdlib",
102 ]
103 } else {
104 sources += [ "default_task_queue_factory_libevent.cc" ]
105 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
106 }
Mirko Bonadeia9cfa472019-02-24 09:17:21107 } else if (is_mac || is_ios) {
Danil Chapovalov07a4f2b2019-03-05 18:58:28108 sources += [ "default_task_queue_factory_gcd.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21109 deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
Philipp Hancke8e2ab672024-01-03 07:20:51110 } else if (is_win && current_os != "winuwp" && !build_with_chromium) {
Danil Chapovalov07a4f2b2019-03-05 18:58:28111 sources += [ "default_task_queue_factory_win.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21112 deps += [ "../../rtc_base:rtc_task_queue_win" ]
113 } else {
Danil Chapovalov07a4f2b2019-03-05 18:58:28114 sources += [ "default_task_queue_factory_stdlib.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21115 deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
Danil Chapovalov87ce8742019-02-01 18:40:11116 }
Danil Chapovalovbaaf9112019-01-18 09:09:40117}
118
Artem Titovc374d112022-06-16 19:27:45119rtc_library("pending_task_safety_flag") {
Artem Titovef159282022-06-17 11:07:03120 visibility = [ "*" ]
Artem Titovc374d112022-06-16 19:27:45121 sources = [
122 "pending_task_safety_flag.cc",
123 "pending_task_safety_flag.h",
124 ]
125 deps = [
Dor Hen5ac2c742024-08-05 08:21:02126 ":task_queue",
Artem Titovc374d112022-06-16 19:27:45127 "../../api:refcountedbase",
128 "../../api:scoped_refptr",
129 "../../api:sequence_checker",
130 "../../rtc_base:checks",
131 "../../rtc_base/system:no_unique_address",
Tommi66bf3f42023-08-24 13:29:10132 "../../rtc_base/system:rtc_export",
Tommifd3b3462023-10-27 20:38:33133 "//third_party/abseil-cpp/absl/base:nullability",
134 "//third_party/abseil-cpp/absl/functional:any_invocable",
135 ]
Artem Titovc374d112022-06-16 19:27:45136}
137
Danil Chapovalov2684ab32019-02-26 09:18:08138if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 19:32:04139 rtc_library("task_queue_default_factory_unittests") {
Danil Chapovalov2684ab32019-02-26 09:18:08140 testonly = true
Mirko Bonadeiccbe95f2020-01-21 11:10:10141 sources = [ "default_task_queue_factory_unittest.cc" ]
Danil Chapovalov2684ab32019-02-26 09:18:08142 deps = [
143 ":default_task_queue_factory",
144 ":task_queue_test",
145 "../../test:test_support",
146 ]
147 }
Artem Titovc374d112022-06-16 19:27:45148
Artem Titovc374d112022-06-16 19:27:45149 rtc_library("pending_task_safety_flag_unittests") {
150 testonly = true
151 sources = [ "pending_task_safety_flag_unittest.cc" ]
152 deps = [
153 ":pending_task_safety_flag",
Dor Hen5ac2c742024-08-05 08:21:02154 ":task_queue",
155 "..:scoped_refptr",
156 "../../rtc_base:checks",
Artem Titovc374d112022-06-16 19:27:45157 "../../rtc_base:logging",
158 "../../rtc_base:rtc_event",
Artem Titovc374d112022-06-16 19:27:45159 "../../rtc_base:task_queue_for_test",
160 "../../test:test_support",
161 ]
162 }
Danil Chapovalov2684ab32019-02-26 09:18:08163}