Danil Chapovalov | 959e9b6 | 2019-01-14 13:29:18 | [diff] [blame] | 1 | # 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 | |
| 9 | import("../../webrtc.gni") |
| 10 | |
Mirko Bonadei | 86d053c | 2019-10-17 19:32:04 | [diff] [blame] | 11 | rtc_library("task_queue") { |
Danil Chapovalov | 959e9b6 | 2019-01-14 13:29:18 | [diff] [blame] | 12 | visibility = [ "*" ] |
| 13 | public = [ |
Danil Chapovalov | 348b08a | 2019-01-17 12:07:25 | [diff] [blame] | 14 | "task_queue_base.h", |
| 15 | "task_queue_factory.h", |
| 16 | ] |
Mirko Bonadei | ccbe95f | 2020-01-21 11:10:10 | [diff] [blame] | 17 | sources = [ "task_queue_base.cc" ] |
Danil Chapovalov | 348b08a | 2019-01-17 12:07:25 | [diff] [blame] | 18 | |
| 19 | deps = [ |
Markus Handell | 2a256c8 | 2023-02-27 11:41:39 | [diff] [blame] | 20 | "..:location", |
Danil Chapovalov | b4c6d1e | 2019-01-21 12:52:59 | [diff] [blame] | 21 | "../../rtc_base:checks", |
Danil Chapovalov | 4423c36 | 2019-03-06 17:41:39 | [diff] [blame] | 22 | "../../rtc_base:macromagic", |
Mirko Bonadei | d4002a7 | 2019-11-12 19:11:48 | [diff] [blame] | 23 | "../../rtc_base/system:rtc_export", |
Danil Chapovalov | 8feb6fd | 2022-07-05 09:01:27 | [diff] [blame] | 24 | "../units:time_delta", |
Danil Chapovalov | 47cf5ea | 2019-02-19 19:20:16 | [diff] [blame] | 25 | "//third_party/abseil-cpp/absl/base:config", |
Danil Chapovalov | 348b08a | 2019-01-17 12:07:25 | [diff] [blame] | 26 | "//third_party/abseil-cpp/absl/base:core_headers", |
Danil Chapovalov | 8feb6fd | 2022-07-05 09:01:27 | [diff] [blame] | 27 | "//third_party/abseil-cpp/absl/functional:any_invocable", |
Florent Castelli | 99c519b | 2024-05-23 11:21:53 | [diff] [blame] | 28 | "//third_party/abseil-cpp/absl/strings:string_view", |
Danil Chapovalov | 959e9b6 | 2019-01-14 13:29:18 | [diff] [blame] | 29 | ] |
| 30 | } |
Danil Chapovalov | baaf911 | 2019-01-18 09:09:40 | [diff] [blame] | 31 | |
Mirko Bonadei | 86d053c | 2019-10-17 19:32:04 | [diff] [blame] | 32 | rtc_library("task_queue_test") { |
Danil Chapovalov | 33b716f | 2019-01-22 17:15:37 | [diff] [blame] | 33 | visibility = [ "*" ] |
| 34 | testonly = true |
| 35 | sources = [ |
| 36 | "task_queue_test.cc", |
| 37 | "task_queue_test.h", |
| 38 | ] |
Mirko Bonadei | c04792e | 2019-10-22 21:57:03 | [diff] [blame] | 39 | |
| 40 | check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/9419) |
| 41 | if (build_with_chromium) { |
Mirko Bonadei | 92dd35d | 2019-11-15 15:08:41 | [diff] [blame] | 42 | visibility = [] |
| 43 | visibility = webrtc_default_visibility |
| 44 | visibility += [ |
Markus Handell | f76a823 | 2022-09-19 14:47:48 | [diff] [blame] | 45 | # 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 Bonadei | 92dd35d | 2019-11-15 15:08:41 | [diff] [blame] | 47 | # it cannot be part of the WebRTC component. |
Markus Handell | f76a823 | 2022-09-19 14:47:48 | [diff] [blame] | 48 | "//components/webrtc:unit_tests", |
Mirko Bonadei | 92dd35d | 2019-11-15 15:08:41 | [diff] [blame] | 49 | "//third_party/blink/renderer/platform:blink_platform_unittests_sources", |
| 50 | ] |
| 51 | |
Mirko Bonadei | c04792e | 2019-10-22 21:57:03 | [diff] [blame] | 52 | # 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 Chapovalov | 8feb6fd | 2022-07-05 09:01:27 | [diff] [blame] | 57 | "//third_party/abseil-cpp/absl/cleanup", |
Mirko Bonadei | c04792e | 2019-10-22 21:57:03 | [diff] [blame] | 58 | "//third_party/abseil-cpp/absl/strings", |
| 59 | ] |
| 60 | } else { |
| 61 | deps = [ |
Ali Tofigh | 4b68194 | 2022-08-23 10:57:16 | [diff] [blame] | 62 | ":default_task_queue_factory", |
Mirko Bonadei | c04792e | 2019-10-22 21:57:03 | [diff] [blame] | 63 | ":task_queue", |
Ali Tofigh | 4b68194 | 2022-08-23 10:57:16 | [diff] [blame] | 64 | "../../api:field_trials_view", |
Markus Handell | 82da932 | 2022-12-16 14:50:24 | [diff] [blame] | 65 | "../../api:make_ref_counted", |
Mirko Bonadei | a8dd3a3 | 2024-08-06 15:49:33 | [diff] [blame] | 66 | "../../api:ref_count", |
Danil Chapovalov | 8feb6fd | 2022-07-05 09:01:27 | [diff] [blame] | 67 | "../../api/units:time_delta", |
Mirko Bonadei | c04792e | 2019-10-22 21:57:03 | [diff] [blame] | 68 | "../../rtc_base:refcount", |
| 69 | "../../rtc_base:rtc_event", |
| 70 | "../../rtc_base:timeutils", |
Mirko Bonadei | c04792e | 2019-10-22 21:57:03 | [diff] [blame] | 71 | "../../test:test_support", |
Danil Chapovalov | 8feb6fd | 2022-07-05 09:01:27 | [diff] [blame] | 72 | "//third_party/abseil-cpp/absl/cleanup", |
Mirko Bonadei | c04792e | 2019-10-22 21:57:03 | [diff] [blame] | 73 | "//third_party/abseil-cpp/absl/strings", |
| 74 | ] |
| 75 | } |
Danil Chapovalov | 33b716f | 2019-01-22 17:15:37 | [diff] [blame] | 76 | } |
| 77 | |
Mirko Bonadei | 86d053c | 2019-10-17 19:32:04 | [diff] [blame] | 78 | rtc_library("default_task_queue_factory") { |
Danil Chapovalov | 2684ab3 | 2019-02-26 09:18:08 | [diff] [blame] | 79 | visibility = [ "*" ] |
Danil Chapovalov | 41300af | 2019-07-10 10:44:43 | [diff] [blame] | 80 | if (!is_ios && !is_android) { |
Danil Chapovalov | 9fdceb8 | 2023-11-27 09:57:22 | [diff] [blame] | 81 | # 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 Chapovalov | 41300af | 2019-07-10 10:44:43 | [diff] [blame] | 85 | } |
Mirko Bonadei | ccbe95f | 2020-01-21 11:10:10 | [diff] [blame] | 86 | sources = [ "default_task_queue_factory.h" ] |
Ali Tofigh | 4b68194 | 2022-08-23 10:57:16 | [diff] [blame] | 87 | deps = [ |
| 88 | ":task_queue", |
| 89 | "../../api:field_trials_view", |
| 90 | "../../rtc_base/memory:always_valid_pointer", |
| 91 | ] |
Danil Chapovalov | 87ce874 | 2019-02-01 18:40:11 | [diff] [blame] | 92 | |
Mirko Bonadei | a9cfa47 | 2019-02-24 09:17:21 | [diff] [blame] | 93 | if (rtc_enable_libevent) { |
Ali Tofigh | 4b68194 | 2022-08-23 10:57:16 | [diff] [blame] | 94 | 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 Bonadei | a9cfa47 | 2019-02-24 09:17:21 | [diff] [blame] | 107 | } else if (is_mac || is_ios) { |
Danil Chapovalov | 07a4f2b | 2019-03-05 18:58:28 | [diff] [blame] | 108 | sources += [ "default_task_queue_factory_gcd.cc" ] |
Mirko Bonadei | a9cfa47 | 2019-02-24 09:17:21 | [diff] [blame] | 109 | deps += [ "../../rtc_base:rtc_task_queue_gcd" ] |
Philipp Hancke | 8e2ab67 | 2024-01-03 07:20:51 | [diff] [blame] | 110 | } else if (is_win && current_os != "winuwp" && !build_with_chromium) { |
Danil Chapovalov | 07a4f2b | 2019-03-05 18:58:28 | [diff] [blame] | 111 | sources += [ "default_task_queue_factory_win.cc" ] |
Mirko Bonadei | a9cfa47 | 2019-02-24 09:17:21 | [diff] [blame] | 112 | deps += [ "../../rtc_base:rtc_task_queue_win" ] |
| 113 | } else { |
Danil Chapovalov | 07a4f2b | 2019-03-05 18:58:28 | [diff] [blame] | 114 | sources += [ "default_task_queue_factory_stdlib.cc" ] |
Mirko Bonadei | a9cfa47 | 2019-02-24 09:17:21 | [diff] [blame] | 115 | deps += [ "../../rtc_base:rtc_task_queue_stdlib" ] |
Danil Chapovalov | 87ce874 | 2019-02-01 18:40:11 | [diff] [blame] | 116 | } |
Danil Chapovalov | baaf911 | 2019-01-18 09:09:40 | [diff] [blame] | 117 | } |
| 118 | |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 119 | rtc_library("pending_task_safety_flag") { |
Artem Titov | ef15928 | 2022-06-17 11:07:03 | [diff] [blame] | 120 | visibility = [ "*" ] |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 121 | sources = [ |
| 122 | "pending_task_safety_flag.cc", |
| 123 | "pending_task_safety_flag.h", |
| 124 | ] |
| 125 | deps = [ |
Dor Hen | 5ac2c74 | 2024-08-05 08:21:02 | [diff] [blame] | 126 | ":task_queue", |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 127 | "../../api:refcountedbase", |
| 128 | "../../api:scoped_refptr", |
| 129 | "../../api:sequence_checker", |
| 130 | "../../rtc_base:checks", |
| 131 | "../../rtc_base/system:no_unique_address", |
Tommi | 66bf3f4 | 2023-08-24 13:29:10 | [diff] [blame] | 132 | "../../rtc_base/system:rtc_export", |
Tommi | fd3b346 | 2023-10-27 20:38:33 | [diff] [blame] | 133 | "//third_party/abseil-cpp/absl/base:nullability", |
| 134 | "//third_party/abseil-cpp/absl/functional:any_invocable", |
| 135 | ] |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 136 | } |
| 137 | |
Danil Chapovalov | 2684ab3 | 2019-02-26 09:18:08 | [diff] [blame] | 138 | if (rtc_include_tests) { |
Mirko Bonadei | 86d053c | 2019-10-17 19:32:04 | [diff] [blame] | 139 | rtc_library("task_queue_default_factory_unittests") { |
Danil Chapovalov | 2684ab3 | 2019-02-26 09:18:08 | [diff] [blame] | 140 | testonly = true |
Mirko Bonadei | ccbe95f | 2020-01-21 11:10:10 | [diff] [blame] | 141 | sources = [ "default_task_queue_factory_unittest.cc" ] |
Danil Chapovalov | 2684ab3 | 2019-02-26 09:18:08 | [diff] [blame] | 142 | deps = [ |
| 143 | ":default_task_queue_factory", |
| 144 | ":task_queue_test", |
| 145 | "../../test:test_support", |
| 146 | ] |
| 147 | } |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 148 | |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 149 | 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 Hen | 5ac2c74 | 2024-08-05 08:21:02 | [diff] [blame] | 154 | ":task_queue", |
| 155 | "..:scoped_refptr", |
| 156 | "../../rtc_base:checks", |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 157 | "../../rtc_base:logging", |
| 158 | "../../rtc_base:rtc_event", |
Artem Titov | c374d11 | 2022-06-16 19:27:45 | [diff] [blame] | 159 | "../../rtc_base:task_queue_for_test", |
| 160 | "../../test:test_support", |
| 161 | ] |
| 162 | } |
Danil Chapovalov | 2684ab3 | 2019-02-26 09:18:08 | [diff] [blame] | 163 | } |