diff --git a/api/BUILD.gn b/api/BUILD.gn index 9ced1f2e58..bee98fe959 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -1468,7 +1468,6 @@ if (rtc_include_tests) { "../rtc_base:gunit_helpers", "../rtc_base:platform_thread", "../rtc_base:rtc_event", - "../rtc_base:rtc_task_queue", "../rtc_base:ssl", "../rtc_base:task_queue_for_test", "../rtc_base/containers:flat_set", diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn index 1b9425d719..d2e96de4d0 100644 --- a/api/task_queue/BUILD.gn +++ b/api/task_queue/BUILD.gn @@ -159,7 +159,6 @@ if (rtc_include_tests) { ":pending_task_safety_flag", "../../rtc_base:logging", "../../rtc_base:rtc_event", - "../../rtc_base:rtc_task_queue", "../../rtc_base:task_queue_for_test", "../../test:test_support", ] diff --git a/call/BUILD.gn b/call/BUILD.gn index 613b2b94d2..85c3332fe1 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -220,7 +220,6 @@ rtc_library("rtp_sender") { "../rtc_base:race_checker", "../rtc_base:random", "../rtc_base:rate_limiter", - "../rtc_base:rtc_task_queue", "../rtc_base:timeutils", "../rtc_base/synchronization:mutex", "../rtc_base/task_utils:repeating_task", @@ -326,7 +325,6 @@ rtc_library("call") { "../rtc_base:macromagic", "../rtc_base:rate_limiter", "../rtc_base:rtc_event", - "../rtc_base:rtc_task_queue", "../rtc_base:safe_minmax", "../rtc_base:stringutils", "../rtc_base:threading", diff --git a/call/adaptation/BUILD.gn b/call/adaptation/BUILD.gn index b69196f021..dd44d1c5cc 100644 --- a/call/adaptation/BUILD.gn +++ b/call/adaptation/BUILD.gn @@ -49,7 +49,6 @@ rtc_library("resource_adaptation") { "../../rtc_base:logging", "../../rtc_base:macromagic", "../../rtc_base:refcount", - "../../rtc_base:rtc_task_queue", "../../rtc_base:safe_conversions", "../../rtc_base:stringutils", "../../rtc_base/experiments:balanced_degradation_settings", @@ -90,7 +89,6 @@ if (rtc_include_tests) { "../../rtc_base:checks", "../../rtc_base:gunit_helpers", "../../rtc_base:rtc_event", - "../../rtc_base:rtc_task_queue", "../../rtc_base:stringutils", "../../rtc_base:task_queue_for_test", "../../rtc_base/synchronization:mutex", diff --git a/call/degraded_call.h b/call/degraded_call.h index 14892f0607..b345ba9e59 100644 --- a/call/degraded_call.h +++ b/call/degraded_call.h @@ -39,7 +39,6 @@ #include "call/video_send_stream.h" #include "rtc_base/copy_on_write_buffer.h" #include "rtc_base/network/sent_packet.h" -#include "rtc_base/task_queue.h" #include "system_wrappers/include/clock.h" #include "video/config/video_encoder_config.h" diff --git a/call/rtp_transport_controller_send.h b/call/rtp_transport_controller_send.h index 4428336672..1438d82851 100644 --- a/call/rtp_transport_controller_send.h +++ b/call/rtp_transport_controller_send.h @@ -38,7 +38,6 @@ #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "rtc_base/network_route.h" #include "rtc_base/race_checker.h" -#include "rtc_base/task_queue.h" #include "rtc_base/task_utils/repeating_task.h" namespace webrtc { diff --git a/call/rtp_transport_controller_send_interface.h b/call/rtp_transport_controller_send_interface.h index c4b1536bad..0cc8bb74d7 100644 --- a/call/rtp_transport_controller_send_interface.h +++ b/call/rtp_transport_controller_send_interface.h @@ -38,7 +38,6 @@ namespace rtc { struct SentPacket; struct NetworkRoute; -class TaskQueue; } // namespace rtc namespace webrtc { diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc index 580850359c..c49d82b095 100644 --- a/call/rtp_video_sender.cc +++ b/call/rtp_video_sender.cc @@ -31,7 +31,6 @@ #include "modules/video_coding/include/video_codec_interface.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" -#include "rtc_base/task_queue.h" #include "rtc_base/trace_event.h" namespace webrtc { diff --git a/common_video/BUILD.gn b/common_video/BUILD.gn index 4736aa5fb6..635e206a24 100644 --- a/common_video/BUILD.gn +++ b/common_video/BUILD.gn @@ -80,7 +80,6 @@ rtc_library("common_video") { "../rtc_base:race_checker", "../rtc_base:rate_statistics", "../rtc_base:refcount", - "../rtc_base:rtc_task_queue", "../rtc_base:safe_minmax", "../rtc_base:timeutils", "../rtc_base/synchronization:mutex", diff --git a/media/BUILD.gn b/media/BUILD.gn index 4a3b018a0f..ab1999aa76 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -106,7 +106,6 @@ rtc_library("rtc_media_base") { "../rtc_base:logging", "../rtc_base:macromagic", "../rtc_base:network_route", - "../rtc_base:rtc_task_queue", "../rtc_base:sanitizer", "../rtc_base:socket", "../rtc_base:stringutils", @@ -716,7 +715,6 @@ if (rtc_include_tests) { "../rtc_base:macromagic", "../rtc_base:network_route", "../rtc_base:rtc_event", - "../rtc_base:rtc_task_queue", "../rtc_base:stringutils", "../rtc_base:threading", "../rtc_base:timeutils", @@ -852,7 +850,6 @@ if (rtc_include_tests) { "../rtc_base:macromagic", "../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_event", - "../rtc_base:rtc_task_queue", "../rtc_base:safe_conversions", "../rtc_base:stringutils", "../rtc_base:threading", diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn index e5f8463419..359867e50c 100644 --- a/modules/audio_device/BUILD.gn +++ b/modules/audio_device/BUILD.gn @@ -289,7 +289,6 @@ rtc_library("audio_device_impl") { "../../rtc_base:platform_thread", "../../rtc_base:random", "../../rtc_base:rtc_event", - "../../rtc_base:rtc_task_queue", "../../rtc_base:safe_conversions", "../../rtc_base:stringutils", "../../rtc_base:timeutils", diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index 817a3515b0..ba9ec95a2d 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -477,7 +477,6 @@ if (rtc_include_tests) { "../../api/audio:audio_frame_api", "../../api/audio:echo_control", "../../rtc_base:rtc_base_tests_utils", - "../../rtc_base:rtc_task_queue", "aec_dump", "aec_dump:aec_dump_unittests", ] diff --git a/modules/pacing/BUILD.gn b/modules/pacing/BUILD.gn index 87498817b6..796f19e485 100644 --- a/modules/pacing/BUILD.gn +++ b/modules/pacing/BUILD.gn @@ -50,7 +50,6 @@ rtc_library("pacing") { "../../rtc_base:logging", "../../rtc_base:macromagic", "../../rtc_base:rtc_numerics", - "../../rtc_base:rtc_task_queue", "../../rtc_base:timeutils", "../../rtc_base/experiments:field_trial_parser", "../../rtc_base/synchronization:mutex", diff --git a/pc/BUILD.gn b/pc/BUILD.gn index f23a27ebde..9ff92b4304 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -2526,7 +2526,6 @@ if (rtc_include_tests && !build_with_chromium) { "../modules/audio_processing:api", "../p2p:p2p_test_utils", "../p2p:rtc_p2p", - "../rtc_base:rtc_task_queue", "../rtc_base:safe_conversions", "../test:audio_codec_mocks", "../test:test_main", @@ -2814,7 +2813,6 @@ if (rtc_include_tests && !build_with_chromium) { "../rtc_base:logging", "../rtc_base:macromagic", "../rtc_base:rtc_certificate_generator", - "../rtc_base:rtc_task_queue", "../rtc_base:ssl", "../rtc_base:stringutils", "../rtc_base:task_queue_for_test", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index 4a0427b332..775b9100e4 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -643,23 +643,6 @@ rtc_source_set("type_traits") { sources = [ "type_traits.h" ] } -rtc_library("rtc_task_queue") { - visibility = [ "*" ] - sources = [ - "task_queue.cc", - "task_queue.h", - ] - deps = [ - ":macromagic", - "../api/task_queue", - "system:rtc_export", - ] - absl_deps = [ - "//third_party/abseil-cpp/absl/functional:any_invocable", - "//third_party/abseil-cpp/absl/memory", - ] -} - rtc_source_set("rtc_operations_chain") { visibility = [ "*" ] sources = [ @@ -1049,7 +1032,6 @@ rtc_library("threading") { ":platform_thread_types", ":refcount", ":rtc_event", - ":rtc_task_queue", ":socket", ":socket_address", ":socket_server", @@ -1954,7 +1936,6 @@ if (rtc_include_tests) { ":rtc_base_tests_utils", ":rtc_event", ":rtc_numerics", - ":rtc_task_queue", ":safe_compare", ":safe_minmax", ":sample_counter", diff --git a/rtc_base/task_queue.cc b/rtc_base/task_queue.cc deleted file mode 100644 index 7c972ed152..0000000000 --- a/rtc_base/task_queue.cc +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2019 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "rtc_base/task_queue.h" - -#include "api/task_queue/task_queue_base.h" - -namespace rtc { - -TaskQueue::TaskQueue( - std::unique_ptr task_queue) - : impl_(task_queue.release()) {} - -TaskQueue::~TaskQueue() { - // There might running task that tries to rescheduler itself to the TaskQueue - // and not yet aware TaskQueue destructor is called. - // Calling back to TaskQueue::PostTask need impl_ pointer still be valid, so - // do not invalidate impl_ pointer until Delete returns. - impl_->Delete(); -} - -bool TaskQueue::IsCurrent() const { - return impl_->IsCurrent(); -} - -} // namespace rtc diff --git a/rtc_base/task_queue.h b/rtc_base/task_queue.h deleted file mode 100644 index e52c49cf00..0000000000 --- a/rtc_base/task_queue.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef RTC_BASE_TASK_QUEUE_H_ -#define RTC_BASE_TASK_QUEUE_H_ - -#include - -#include -#include - -#include "absl/functional/any_invocable.h" -#include "absl/memory/memory.h" -#include "api/task_queue/task_queue_base.h" -#include "api/task_queue/task_queue_factory.h" -#include "rtc_base/system/rtc_export.h" -#include "rtc_base/thread_annotations.h" - -namespace rtc { -// Implements a task queue that asynchronously executes tasks in a way that -// guarantees that they're executed in FIFO order and that tasks never overlap. -// Tasks may always execute on the same worker thread and they may not. -// To DCHECK that tasks are executing on a known task queue, use IsCurrent(). -// -// Here are some usage examples: -// -// 1) Asynchronously running a lambda: -// -// class MyClass { -// ... -// TaskQueue queue_("MyQueue"); -// }; -// -// void MyClass::StartWork() { -// queue_.PostTask([]() { Work(); }); -// ... -// -// 2) Posting a custom task on a timer. The task posts itself again after -// every running: -// -// class TimerTask : public QueuedTask { -// public: -// TimerTask() {} -// private: -// bool Run() override { -// ++count_; -// TaskQueueBase::Current()->PostDelayedTask( -// absl::WrapUnique(this), 1000); -// // Ownership has been transferred to the next occurance, -// // so return false to prevent from being deleted now. -// return false; -// } -// int count_ = 0; -// }; -// ... -// queue_.PostDelayedTask(std::make_unique(), 1000); -// -// For more examples, see task_queue_unittests.cc. -// -// A note on destruction: -// -// When a TaskQueue is deleted, pending tasks will not be executed but they will -// be deleted. The deletion of tasks may happen asynchronously after the -// TaskQueue itself has been deleted or it may happen synchronously while the -// TaskQueue instance is being deleted. This may vary from one OS to the next -// so assumptions about lifetimes of pending tasks should not be made. -class RTC_LOCKABLE RTC_EXPORT TaskQueue { - public: - // TaskQueue priority levels. On some platforms these will map to thread - // priorities, on others such as Mac and iOS, GCD queue priorities. - using Priority = ::webrtc::TaskQueueFactory::Priority; - - explicit TaskQueue(std::unique_ptr task_queue); - ~TaskQueue(); - - TaskQueue(const TaskQueue&) = delete; - TaskQueue& operator=(const TaskQueue&) = delete; - - // Used for DCHECKing the current queue. - bool IsCurrent() const; - - // Returns non-owning pointer to the task queue implementation. - webrtc::TaskQueueBase* Get() { return impl_; } - - void PostTask( - absl::AnyInvocable task, - const webrtc::Location& location = webrtc::Location::Current()) { - impl_->PostTask(std::move(task), location); - } - void PostDelayedTask( - absl::AnyInvocable task, - webrtc::TimeDelta delay, - const webrtc::Location& location = webrtc::Location::Current()) { - impl_->PostDelayedTask(std::move(task), delay, location); - } - void PostDelayedHighPrecisionTask( - absl::AnyInvocable task, - webrtc::TimeDelta delay, - const webrtc::Location& location = webrtc::Location::Current()) { - impl_->PostDelayedHighPrecisionTask(std::move(task), delay, location); - } - - private: - webrtc::TaskQueueBase* const impl_; -}; - -} // namespace rtc - -#endif // RTC_BASE_TASK_QUEUE_H_ diff --git a/rtc_base/task_utils/BUILD.gn b/rtc_base/task_utils/BUILD.gn index c81232cf7e..a2a3e6572f 100644 --- a/rtc_base/task_utils/BUILD.gn +++ b/rtc_base/task_utils/BUILD.gn @@ -33,7 +33,6 @@ if (rtc_include_tests) { deps = [ ":repeating_task", "..:rtc_event", - "..:rtc_task_queue", "..:task_queue_for_test", "../../api/task_queue", "../../api/task_queue/test:mock_task_queue_base", diff --git a/rtc_tools/network_tester/BUILD.gn b/rtc_tools/network_tester/BUILD.gn index da62266520..b620385160 100644 --- a/rtc_tools/network_tester/BUILD.gn +++ b/rtc_tools/network_tester/BUILD.gn @@ -52,7 +52,6 @@ if (rtc_enable_protobuf) { "../../rtc_base:logging", "../../rtc_base:macromagic", "../../rtc_base:protobuf_utils", - "../../rtc_base:rtc_task_queue", "../../rtc_base:socket_address", "../../rtc_base:socket_server", "../../rtc_base:threading", diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn index 87e76235ee..89a78b5609 100644 --- a/sdk/android/BUILD.gn +++ b/sdk/android/BUILD.gn @@ -682,7 +682,6 @@ if (current_os == "linux" || is_android) { "../../rtc_base:logging", "../../rtc_base:race_checker", "../../rtc_base:refcount", - "../../rtc_base:rtc_task_queue", "../../rtc_base:safe_conversions", "../../rtc_base:threading", "../../rtc_base:timestamp_aligner", @@ -801,7 +800,6 @@ if (current_os == "linux" || is_android) { "../../rtc_base:logging", "../../rtc_base:refcount", "../../rtc_base:rtc_certificate_generator", - "../../rtc_base:rtc_task_queue", "../../rtc_base:safe_conversions", "../../rtc_base:ssl", "../../rtc_base:stringutils",