Migrate remaining webrtc usage of TaskQueueBase to absl::AnyInvocable

Bug: webrtc:14245
Change-Id: I8de2c23da5fbdfc0b1efbbe07fb6e8de744424a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268191
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37565}
This commit is contained in:
Danil Chapovalov
2022-07-19 13:07:12 +02:00
committed by WebRTC LUCI CQ
parent 489f648ea3
commit c05a1be5b4
37 changed files with 85 additions and 140 deletions

View File

@ -19,7 +19,6 @@
#endif
#include "api/sequence_checker.h"
#include "api/task_queue/to_queued_task.h"
#include "rtc_base/checks.h"
#include "rtc_base/ip_address.h"
#include "rtc_base/logging.h"
@ -631,7 +630,7 @@ AndroidNetworkMonitorFactory::CreateNetworkMonitor(
void AndroidNetworkMonitor::NotifyConnectionTypeChanged(
JNIEnv* env,
const JavaRef<jobject>& j_caller) {
network_thread_->PostTask(ToQueuedTask(safety_flag_, [this] {
network_thread_->PostTask(SafeTask(safety_flag_, [this] {
RTC_LOG(LS_INFO)
<< "Android network monitor detected connection type change.";
InvokeNetworksChangedCallback();
@ -654,8 +653,8 @@ void AndroidNetworkMonitor::NotifyOfNetworkConnect(
const JavaRef<jobject>& j_network_info) {
NetworkInformation network_info =
GetNetworkInformationFromJava(env, j_network_info);
network_thread_->PostTask(ToQueuedTask(
safety_flag_, [this, network_info = std::move(network_info)] {
network_thread_->PostTask(
SafeTask(safety_flag_, [this, network_info = std::move(network_info)] {
OnNetworkConnected_n(network_info);
}));
}
@ -664,7 +663,7 @@ void AndroidNetworkMonitor::NotifyOfNetworkDisconnect(
JNIEnv* env,
const JavaRef<jobject>& j_caller,
jlong network_handle) {
network_thread_->PostTask(ToQueuedTask(safety_flag_, [this, network_handle] {
network_thread_->PostTask(SafeTask(safety_flag_, [this, network_handle] {
OnNetworkDisconnected_n(static_cast<NetworkHandle>(network_handle));
}));
}
@ -678,9 +677,9 @@ void AndroidNetworkMonitor::NotifyOfNetworkPreference(
rtc::NetworkPreference preference =
static_cast<rtc::NetworkPreference>(jpreference);
network_thread_->PostTask(ToQueuedTask(
safety_flag_,
[this, type, preference] { OnNetworkPreference_n(type, preference); }));
network_thread_->PostTask(SafeTask(safety_flag_, [this, type, preference] {
OnNetworkPreference_n(type, preference);
}));
}
} // namespace jni

View File

@ -12,7 +12,6 @@
#include <utility>
#include "api/task_queue/to_queued_task.h"
#include "common_video/h264/h264_common.h"
#include "modules/video_coding/include/video_codec_interface.h"
#include "modules/video_coding/include/video_error_codes.h"