Remove rtc::Location from SendTask test helper
that rtc::Location parameter was used only as extra information for the
RTC_CHECKs directly in the function, thus call stack of the crash should
provide all the information about the caller.
Bug: webrtc:11318
Change-Id: Iec6dd2c5de547f3e1601647a614be7ce57a55734
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270920
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37748}
diff --git a/test/call_test.cc b/test/call_test.cc
index af49f5b..7e7a87c 100644
--- a/test/call_test.cc
+++ b/test/call_test.cc
@@ -87,7 +87,7 @@
}
void CallTest::RunBaseTest(BaseTest* test) {
- SendTask(RTC_FROM_HERE, task_queue(), [this, test]() {
+ SendTask(task_queue(), [this, test]() {
num_video_streams_ = test->GetNumVideoStreams();
num_audio_streams_ = test->GetNumAudioStreams();
num_flexfec_streams_ = test->GetNumFlexfecStreams();
@@ -187,7 +187,7 @@
test->PerformTest();
- SendTask(RTC_FROM_HERE, task_queue(), [this, test]() {
+ SendTask(task_queue(), [this, test]() {
Stop();
test->OnStreamsStopped();
DestroyStreams();
diff --git a/test/network/network_emulation_manager.cc b/test/network/network_emulation_manager.cc
index 2c96191..a02b5f4 100644
--- a/test/network/network_emulation_manager.cc
+++ b/test/network/network_emulation_manager.cc
@@ -188,27 +188,24 @@
void NetworkEmulationManagerImpl::ClearRoute(EmulatedRoute* route) {
RTC_CHECK(route->active) << "Route already cleared";
- task_queue_.SendTask(
- [route]() {
- // Remove receiver from intermediate nodes.
- for (auto* node : route->via_nodes) {
- if (route->is_default) {
- node->router()->RemoveDefaultReceiver();
- } else {
- node->router()->RemoveReceiver(route->to->GetPeerLocalAddress());
- }
- }
- // Remove destination endpoint from source endpoint's router.
- if (route->is_default) {
- route->from->router()->RemoveDefaultReceiver();
- } else {
- route->from->router()->RemoveReceiver(
- route->to->GetPeerLocalAddress());
- }
+ task_queue_.SendTask([route]() {
+ // Remove receiver from intermediate nodes.
+ for (auto* node : route->via_nodes) {
+ if (route->is_default) {
+ node->router()->RemoveDefaultReceiver();
+ } else {
+ node->router()->RemoveReceiver(route->to->GetPeerLocalAddress());
+ }
+ }
+ // Remove destination endpoint from source endpoint's router.
+ if (route->is_default) {
+ route->from->router()->RemoveDefaultReceiver();
+ } else {
+ route->from->router()->RemoveReceiver(route->to->GetPeerLocalAddress());
+ }
- route->active = false;
- },
- RTC_FROM_HERE);
+ route->active = false;
+ });
}
TcpMessageRoute* NetworkEmulationManagerImpl::CreateTcpRoute(
diff --git a/test/pc/e2e/BUILD.gn b/test/pc/e2e/BUILD.gn
index 8f1c59b..b0f1f0f 100644
--- a/test/pc/e2e/BUILD.gn
+++ b/test/pc/e2e/BUILD.gn
@@ -355,7 +355,6 @@
"../../../api/units:timestamp",
"../../../rtc_base:checks",
"../../../rtc_base:criticalsection",
- "../../../rtc_base:location",
"../../../rtc_base:logging",
"../../../rtc_base:task_queue_for_test",
"../../../rtc_base/synchronization:mutex",
diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc
index 409430d..596d118 100644
--- a/test/pc/e2e/peer_connection_quality_test.cc
+++ b/test/pc/e2e/peer_connection_quality_test.cc
@@ -379,12 +379,10 @@
// There is no guarantee, that last stats collection will happen at the end
// of the call, so we force it after executor, which is among others is doing
// stats collection, was stopped.
- task_queue_->SendTask(
- [&stats_poller]() {
- // Get final end-of-call stats.
- stats_poller.PollStatsAndNotifyObservers();
- },
- RTC_FROM_HERE);
+ task_queue_->SendTask([&stats_poller]() {
+ // Get final end-of-call stats.
+ stats_poller.PollStatsAndNotifyObservers();
+ });
// We need to detach AEC dumping from peers, because dump uses `task_queue_`
// inside.
alice_->DetachAecDump();
diff --git a/test/pc/e2e/test_activities_executor.cc b/test/pc/e2e/test_activities_executor.cc
index 9a62e14..7bcf7dd 100644
--- a/test/pc/e2e/test_activities_executor.cc
+++ b/test/pc/e2e/test_activities_executor.cc
@@ -15,7 +15,6 @@
#include "absl/memory/memory.h"
#include "rtc_base/checks.h"
-#include "rtc_base/location.h"
#include "rtc_base/logging.h"
#include "rtc_base/task_queue_for_test.h"
@@ -38,7 +37,7 @@
// Already stopped or not started.
return;
}
- SendTask(RTC_FROM_HERE, task_queue_, [this]() {
+ SendTask(task_queue_, [this]() {
MutexLock lock(&lock_);
for (auto& handle : repeating_task_handles_) {
handle.Stop();
diff --git a/test/scenario/call_client.cc b/test/scenario/call_client.cc
index 4ae0a64..c9babc7 100644
--- a/test/scenario/call_client.cc
+++ b/test/scenario/call_client.cc
@@ -334,7 +334,7 @@
}
void CallClient::SendTask(std::function<void()> task) {
- task_queue_.SendTask(std::move(task), RTC_FROM_HERE);
+ task_queue_.SendTask(std::move(task));
}
int16_t CallClient::Bind(EmulatedEndpoint* endpoint) {
diff --git a/test/scenario/video_frame_matcher.cc b/test/scenario/video_frame_matcher.cc
index 20cfb0e..dc8cd59 100644
--- a/test/scenario/video_frame_matcher.cc
+++ b/test/scenario/video_frame_matcher.cc
@@ -29,7 +29,7 @@
task_queue_("VideoAnalyzer") {}
VideoFrameMatcher::~VideoFrameMatcher() {
- task_queue_.SendTask([this] { Finalize(); }, RTC_FROM_HERE);
+ task_queue_.SendTask([this] { Finalize(); });
}
void VideoFrameMatcher::RegisterLayer(int layer_id) {