blob: 8daa01d26b5b5072172881187bd19d07c682eda5 [file] [log] [blame]
Danil Chapovalov959e9b62019-01-14 14:29:18 +01001# 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 21:32:04 +020011rtc_library("task_queue") {
Danil Chapovalov959e9b62019-01-14 14:29:18 +010012 visibility = [ "*" ]
13 public = [
Danil Chapovalov348b08a2019-01-17 13:07:25 +010014 "task_queue_base.h",
15 "task_queue_factory.h",
16 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010017 sources = [ "task_queue_base.cc" ]
Danil Chapovalov348b08a2019-01-17 13:07:25 +010018
19 deps = [
Danil Chapovalovb4c6d1e2019-01-21 13:52:59 +010020 "../../rtc_base:checks",
Danil Chapovalov4423c362019-03-06 18:41:39 +010021 "../../rtc_base:macromagic",
Mirko Bonadeid4002a72019-11-12 20:11:48 +010022 "../../rtc_base/system:rtc_export",
Danil Chapovalov8feb6fd2022-07-05 11:01:27 +020023 "../units:time_delta",
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020024 ]
25 absl_deps = [
Danil Chapovalov47cf5ea2019-02-19 20:20:16 +010026 "//third_party/abseil-cpp/absl/base:config",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010027 "//third_party/abseil-cpp/absl/base:core_headers",
Danil Chapovalov8feb6fd2022-07-05 11:01:27 +020028 "//third_party/abseil-cpp/absl/functional:any_invocable",
Danil Chapovalov348b08a2019-01-17 13:07:25 +010029 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov959e9b62019-01-14 14:29:18 +010030 ]
31}
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010032
Mirko Bonadei86d053c2019-10-17 21:32:04 +020033rtc_library("task_queue_test") {
Danil Chapovalov33b716f2019-01-22 18:15:37 +010034 visibility = [ "*" ]
35 testonly = true
36 sources = [
37 "task_queue_test.cc",
38 "task_queue_test.h",
39 ]
Mirko Bonadeic04792e2019-10-22 14:57:03 -070040
41 check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/9419)
42 if (build_with_chromium) {
Mirko Bonadei92dd35d2019-11-15 16:08:41 +010043 visibility = []
44 visibility = webrtc_default_visibility
45 visibility += [
46 # This is the only Chromium target that can depend on this. The reason
47 # behind this is the fact that this is a 'testonly' target and as such
48 # it cannot be part of the WebRTC component.
49 "//third_party/blink/renderer/platform:blink_platform_unittests_sources",
50 ]
51
Mirko Bonadeic04792e2019-10-22 14:57:03 -070052 # 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",
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020057 ]
58 absl_deps = [
Danil Chapovalov8feb6fd2022-07-05 11:01:27 +020059 "//third_party/abseil-cpp/absl/cleanup",
Mirko Bonadeic04792e2019-10-22 14:57:03 -070060 "//third_party/abseil-cpp/absl/strings",
61 ]
62 } else {
63 deps = [
64 ":task_queue",
Danil Chapovalov8feb6fd2022-07-05 11:01:27 +020065 "../../api/units:time_delta",
Mirko Bonadeic04792e2019-10-22 14:57:03 -070066 "../../rtc_base:refcount",
67 "../../rtc_base:rtc_event",
68 "../../rtc_base:timeutils",
Mirko Bonadeic04792e2019-10-22 14:57:03 -070069 "../../test:test_support",
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020070 ]
71 absl_deps = [
Danil Chapovalov8feb6fd2022-07-05 11:01:27 +020072 "//third_party/abseil-cpp/absl/cleanup",
Mirko Bonadeic04792e2019-10-22 14:57:03 -070073 "//third_party/abseil-cpp/absl/strings",
74 ]
75 }
Danil Chapovalov33b716f2019-01-22 18:15:37 +010076}
77
Mirko Bonadei86d053c2019-10-17 21:32:04 +020078rtc_library("default_task_queue_factory") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +010079 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +020080 if (!is_ios && !is_android) {
81 poisonous = [ "default_task_queue" ]
82 }
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010083 sources = [ "default_task_queue_factory.h" ]
84 deps = [ ":task_queue" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010085
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000086 if (rtc_enable_libevent) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010087 sources += [ "default_task_queue_factory_libevent.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000088 deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
89 } else if (is_mac || is_ios) {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010090 sources += [ "default_task_queue_factory_gcd.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000091 deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
92 } else if (is_win && current_os != "winuwp") {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010093 sources += [ "default_task_queue_factory_win.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000094 deps += [ "../../rtc_base:rtc_task_queue_win" ]
95 } else {
Danil Chapovalov07a4f2b2019-03-05 19:58:28 +010096 sources += [ "default_task_queue_factory_stdlib.cc" ]
Mirko Bonadeia9cfa472019-02-24 09:17:21 +000097 deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
Danil Chapovalov87ce8742019-02-01 19:40:11 +010098 }
Danil Chapovalovbaaf9112019-01-18 10:09:40 +010099}
100
Artem Titovc374d112022-06-16 21:27:45 +0200101rtc_library("pending_task_safety_flag") {
Artem Titovef159282022-06-17 13:07:03 +0200102 visibility = [ "*" ]
Artem Titovc374d112022-06-16 21:27:45 +0200103 sources = [
104 "pending_task_safety_flag.cc",
105 "pending_task_safety_flag.h",
106 ]
107 deps = [
108 "../../api:refcountedbase",
109 "../../api:scoped_refptr",
110 "../../api:sequence_checker",
111 "../../rtc_base:checks",
112 "../../rtc_base/system:no_unique_address",
113 ]
Danil Chapovalova7e15a22022-07-05 16:03:03 +0200114 absl_deps = [ "//third_party/abseil-cpp/absl/functional:any_invocable" ]
Artem Titovc374d112022-06-16 21:27:45 +0200115}
116
Danil Chapovalov2684ab32019-02-26 10:18:08 +0100117if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200118 rtc_library("task_queue_default_factory_unittests") {
Danil Chapovalov2684ab32019-02-26 10:18:08 +0100119 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100120 sources = [ "default_task_queue_factory_unittest.cc" ]
Danil Chapovalov2684ab32019-02-26 10:18:08 +0100121 deps = [
122 ":default_task_queue_factory",
123 ":task_queue_test",
124 "../../test:test_support",
125 ]
126 }
Artem Titovc374d112022-06-16 21:27:45 +0200127
Artem Titovc374d112022-06-16 21:27:45 +0200128 rtc_library("pending_task_safety_flag_unittests") {
129 testonly = true
130 sources = [ "pending_task_safety_flag_unittest.cc" ]
131 deps = [
132 ":pending_task_safety_flag",
Artem Titovc374d112022-06-16 21:27:45 +0200133 "../../rtc_base:logging",
134 "../../rtc_base:rtc_event",
135 "../../rtc_base:rtc_task_queue",
136 "../../rtc_base:task_queue_for_test",
137 "../../test:test_support",
138 ]
139 }
Danil Chapovalov2684ab32019-02-26 10:18:08 +0100140}