diff --git a/video/BUILD.gn b/video/BUILD.gn
index 64308ad..5176e13 100644
--- a/video/BUILD.gn
+++ b/video/BUILD.gn
@@ -868,7 +868,6 @@
       "../rtc_base:byte_buffer",
       "../rtc_base:checks",
       "../rtc_base:gunit_helpers",
-      "../rtc_base:location",
       "../rtc_base:logging",
       "../rtc_base:macromagic",
       "../rtc_base:platform_thread",
diff --git a/video/adaptation/overuse_frame_detector_unittest.cc b/video/adaptation/overuse_frame_detector_unittest.cc
index e607a04..ff1f4d8 100644
--- a/video/adaptation/overuse_frame_detector_unittest.cc
+++ b/video/adaptation/overuse_frame_detector_unittest.cc
@@ -432,12 +432,9 @@
 TEST_F(OveruseFrameDetectorTest, RunOnTqNormalUsage) {
   TaskQueueForTest queue("OveruseFrameDetectorTestQueue");
 
-  queue.SendTask(
-      [&] {
-        overuse_detector_->StartCheckForOveruse(queue.Get(), options_,
-                                                observer_);
-      },
-      RTC_FROM_HERE);
+  queue.SendTask([&] {
+    overuse_detector_->StartCheckForOveruse(queue.Get(), options_, observer_);
+  });
 
   rtc::Event event;
   // Expect NormalUsage(). When called, stop the `overuse_detector_` and then
@@ -917,12 +914,9 @@
 TEST_F(OveruseFrameDetectorTest2, RunOnTqNormalUsage) {
   TaskQueueForTest queue("OveruseFrameDetectorTestQueue");
 
-  queue.SendTask(
-      [&] {
-        overuse_detector_->StartCheckForOveruse(queue.Get(), options_,
-                                                observer_);
-      },
-      RTC_FROM_HERE);
+  queue.SendTask([&] {
+    overuse_detector_->StartCheckForOveruse(queue.Get(), options_, observer_);
+  });
 
   rtc::Event event;
   // Expect NormalUsage(). When called, stop the `overuse_detector_` and then
diff --git a/video/end_to_end_tests/bandwidth_tests.cc b/video/end_to_end_tests/bandwidth_tests.cc
index c21b3ba..c5488ea 100644
--- a/video/end_to_end_tests/bandwidth_tests.cc
+++ b/video/end_to_end_tests/bandwidth_tests.cc
@@ -95,7 +95,7 @@
   ~BandwidthStatsTest() override {
     // Block until all already posted tasks run to avoid races when such task
     // accesses `this`.
-    SendTask(RTC_FROM_HERE, task_queue_, [] {});
+    SendTask(task_queue_, [] {});
   }
 
   void ModifyVideoConfigs(
@@ -358,7 +358,7 @@
       ASSERT_TRUE(Wait())
           << "Timed out while waiting for encoder SetRates() call.";
 
-      SendTask(RTC_FROM_HERE, task_queue_, [this]() {
+      SendTask(task_queue_, [this]() {
         WaitForEncoderTargetBitrateMatchStats();
         send_stream_->Stop();
         WaitForStatsReportZeroTargetBitrate();
diff --git a/video/end_to_end_tests/call_operation_tests.cc b/video/end_to_end_tests/call_operation_tests.cc
index fcf7660..5c87bc1 100644
--- a/video/end_to_end_tests/call_operation_tests.cc
+++ b/video/end_to_end_tests/call_operation_tests.cc
@@ -98,9 +98,8 @@
   std::unique_ptr<test::DirectTransport> receiver_transport;
 
   SendTask(
-      RTC_FROM_HERE, task_queue(),
-      [this, &renderer, &frame_forwarder, &sender_transport,
-       &receiver_transport]() {
+      task_queue(), [this, &renderer, &frame_forwarder, &sender_transport,
+                     &receiver_transport]() {
         CreateCalls();
 
         sender_transport = std::make_unique<test::DirectTransport>(
@@ -146,14 +145,13 @@
   EXPECT_TRUE(renderer.Wait())
       << "Timed out while waiting for the frame to render.";
 
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &sender_transport, &receiver_transport]() {
-             Stop();
-             DestroyStreams();
-             sender_transport.reset();
-             receiver_transport.reset();
-             DestroyCalls();
-           });
+  SendTask(task_queue(), [this, &sender_transport, &receiver_transport]() {
+    Stop();
+    DestroyStreams();
+    sender_transport.reset();
+    receiver_transport.reset();
+    DestroyCalls();
+  });
 }
 
 TEST_F(CallOperationEndToEndTest, TransmitsFirstFrame) {
@@ -173,9 +171,8 @@
   std::unique_ptr<test::DirectTransport> receiver_transport;
 
   SendTask(
-      RTC_FROM_HERE, task_queue(),
-      [this, &renderer, &frame_generator, &frame_forwarder, &sender_transport,
-       &receiver_transport]() {
+      task_queue(), [this, &renderer, &frame_generator, &frame_forwarder,
+                     &sender_transport, &receiver_transport]() {
         CreateCalls();
 
         sender_transport = std::make_unique<test::DirectTransport>(
@@ -216,14 +213,13 @@
   EXPECT_TRUE(renderer.Wait())
       << "Timed out while waiting for the frame to render.";
 
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &sender_transport, &receiver_transport]() {
-             Stop();
-             DestroyStreams();
-             sender_transport.reset();
-             receiver_transport.reset();
-             DestroyCalls();
-           });
+  SendTask(task_queue(), [this, &sender_transport, &receiver_transport]() {
+    Stop();
+    DestroyStreams();
+    sender_transport.reset();
+    receiver_transport.reset();
+    DestroyCalls();
+  });
 }
 
 }  // namespace webrtc
diff --git a/video/end_to_end_tests/multi_codec_receive_tests.cc b/video/end_to_end_tests/multi_codec_receive_tests.cc
index d9d7821..e397402 100644
--- a/video/end_to_end_tests/multi_codec_receive_tests.cc
+++ b/video/end_to_end_tests/multi_codec_receive_tests.cc
@@ -129,7 +129,7 @@
 class MultiCodecReceiveTest : public test::CallTest {
  public:
   MultiCodecReceiveTest() {
-    SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+    SendTask(task_queue(), [this]() {
       CreateCalls();
 
       send_transport_.reset(new test::PacketTransport(
@@ -151,7 +151,7 @@
   }
 
   virtual ~MultiCodecReceiveTest() {
-    SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+    SendTask(task_queue(), [this]() {
       send_transport_.reset();
       receive_transport_.reset();
       DestroyCalls();
@@ -243,7 +243,7 @@
         return nullptr;
       });
   // Create and start call.
-  SendTask(RTC_FROM_HERE, task_queue(),
+  SendTask(task_queue(),
            [this, &configs, &encoder_factory, &decoder_factory]() {
              CreateSendConfig(1, 0, 0, send_transport_.get());
              ConfigureEncoder(configs[0], &encoder_factory);
@@ -261,21 +261,20 @@
 
   for (size_t i = 1; i < configs.size(); ++i) {
     // Recreate VideoSendStream with new config (codec, temporal layers).
-    SendTask(
-        RTC_FROM_HERE, task_queue(), [this, i, &configs, &encoder_factory]() {
-          DestroyVideoSendStreams();
-          observer_.Reset(PayloadNameToPayloadType(configs[i].payload_name));
+    SendTask(task_queue(), [this, i, &configs, &encoder_factory]() {
+      DestroyVideoSendStreams();
+      observer_.Reset(PayloadNameToPayloadType(configs[i].payload_name));
 
-          ConfigureEncoder(configs[i], &encoder_factory);
-          CreateVideoSendStreams();
-          GetVideoSendStream()->Start();
-          CreateFrameGeneratorCapturer(kFps, kWidth / 2, kHeight / 2);
-          ConnectVideoSourcesToStreams();
-        });
+      ConfigureEncoder(configs[i], &encoder_factory);
+      CreateVideoSendStreams();
+      GetVideoSendStream()->Start();
+      CreateFrameGeneratorCapturer(kFps, kWidth / 2, kHeight / 2);
+      ConnectVideoSourcesToStreams();
+    });
     EXPECT_TRUE(observer_.Wait()) << "Timed out waiting for frames.";
   }
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     Stop();
     DestroyStreams();
   });
diff --git a/video/end_to_end_tests/multi_stream_tester.cc b/video/end_to_end_tests/multi_stream_tester.cc
index 8ca06d7..b455672 100644
--- a/video/end_to_end_tests/multi_stream_tester.cc
+++ b/video/end_to_end_tests/multi_stream_tester.cc
@@ -67,7 +67,7 @@
       CreateBuiltinVideoBitrateAllocatorFactory();
   InternalDecoderFactory decoder_factory;
 
-  SendTask(RTC_FROM_HERE, task_queue.get(), [&]() {
+  SendTask(task_queue.get(), [&]() {
     sender_call = absl::WrapUnique(Call::Create(config));
     receiver_call = absl::WrapUnique(Call::Create(config));
     sender_transport = CreateSendTransport(task_queue.get(), sender_call.get());
@@ -129,7 +129,7 @@
 
   Wait();
 
-  SendTask(RTC_FROM_HERE, task_queue.get(), [&]() {
+  SendTask(task_queue.get(), [&]() {
     for (size_t i = 0; i < kNumStreams; ++i) {
       frame_generators[i]->Stop();
       sender_call->DestroyVideoSendStream(send_streams[i]);
diff --git a/video/end_to_end_tests/network_state_tests.cc b/video/end_to_end_tests/network_state_tests.cc
index 3618673..fdb0b18 100644
--- a/video/end_to_end_tests/network_state_tests.cc
+++ b/video/end_to_end_tests/network_state_tests.cc
@@ -19,7 +19,6 @@
 #include "call/fake_network_pipe.h"
 #include "call/simulated_network.h"
 #include "modules/rtp_rtcp/source/rtp_packet.h"
-#include "rtc_base/location.h"
 #include "rtc_base/synchronization/mutex.h"
 #include "rtc_base/task_queue_for_test.h"
 #include "system_wrappers/include/sleep.h"
@@ -95,7 +94,7 @@
     Transport* transport) {
   test::VideoEncoderProxyFactory encoder_factory(encoder);
 
-  SendTask(RTC_FROM_HERE, task_queue(),
+  SendTask(task_queue(),
            [this, network_to_bring_up, &encoder_factory, transport]() {
              CreateSenderCall(Call::Config(send_event_log_.get()));
              sender_call_->SignalChannelNetworkState(network_to_bring_up,
@@ -113,7 +112,7 @@
 
   SleepMs(kSilenceTimeoutMs);
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     Stop();
     DestroyStreams();
     DestroyCalls();
@@ -126,7 +125,7 @@
   std::unique_ptr<test::DirectTransport> sender_transport;
 
   SendTask(
-      RTC_FROM_HERE, task_queue(),
+      task_queue(),
       [this, &sender_transport, network_to_bring_up, transport]() {
         CreateCalls();
         receiver_call_->SignalChannelNetworkState(network_to_bring_up,
@@ -148,7 +147,7 @@
 
   SleepMs(kSilenceTimeoutMs);
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this, &sender_transport]() {
+  SendTask(task_queue(), [this, &sender_transport]() {
     Stop();
     DestroyStreams();
     sender_transport.reset();
@@ -230,17 +229,16 @@
     void SignalChannelNetworkState(Call* call,
                                    MediaType media_type,
                                    NetworkState network_state) {
-      SendTask(RTC_FROM_HERE, e2e_test_task_queue_,
-               [call, media_type, network_state] {
-                 call->SignalChannelNetworkState(media_type, network_state);
-               });
+      SendTask(e2e_test_task_queue_, [call, media_type, network_state] {
+        call->SignalChannelNetworkState(media_type, network_state);
+      });
     }
 
     void PerformTest() override {
       EXPECT_TRUE(encoded_frames_.Wait(kDefaultTimeoutMs))
           << "No frames received by the encoder.";
 
-      SendTask(RTC_FROM_HERE, task_queue_.get(), [this]() {
+      SendTask(task_queue_.get(), [this]() {
         // Wait for packets from both sender/receiver.
         WaitForPacketsOrSilence(false, false);
 
diff --git a/video/end_to_end_tests/rtp_rtcp_tests.cc b/video/end_to_end_tests/rtp_rtcp_tests.cc
index fe59bfc..02672ef 100644
--- a/video/end_to_end_tests/rtp_rtcp_tests.cc
+++ b/video/end_to_end_tests/rtp_rtcp_tests.cc
@@ -284,9 +284,8 @@
   VideoEncoderConfig one_stream;
 
   SendTask(
-      RTC_FROM_HERE, task_queue(),
-      [this, &observer, &send_transport, &receive_transport, &one_stream,
-       use_rtx]() {
+      task_queue(), [this, &observer, &send_transport, &receive_transport,
+                     &one_stream, use_rtx]() {
         CreateCalls();
 
         send_transport = std::make_unique<test::PacketTransport>(
@@ -336,7 +335,7 @@
   // Test stream resetting more than once to make sure that the state doesn't
   // get set once (this could be due to using std::map::insert for instance).
   for (size_t i = 0; i < 3; ++i) {
-    SendTask(RTC_FROM_HERE, task_queue(), [&]() {
+    SendTask(task_queue(), [&]() {
       DestroyVideoSendStreams();
 
       // Re-create VideoSendStream with only one stream.
@@ -358,7 +357,7 @@
     EXPECT_TRUE(observer.Wait()) << "Timed out waiting for single RTP packet.";
 
     // Reconfigure back to use all streams.
-    SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+    SendTask(task_queue(), [this]() {
       GetVideoSendStream()->ReconfigureVideoEncoder(
           GetVideoEncoderConfig()->Copy());
     });
@@ -367,14 +366,14 @@
         << "Timed out waiting for all SSRCs to send packets.";
 
     // Reconfigure down to one stream.
-    SendTask(RTC_FROM_HERE, task_queue(), [this, &one_stream]() {
+    SendTask(task_queue(), [this, &one_stream]() {
       GetVideoSendStream()->ReconfigureVideoEncoder(one_stream.Copy());
     });
     observer.ResetExpectedSsrcs(1);
     EXPECT_TRUE(observer.Wait()) << "Timed out waiting for single RTP packet.";
 
     // Reconfigure back to use all streams.
-    SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+    SendTask(task_queue(), [this]() {
       GetVideoSendStream()->ReconfigureVideoEncoder(
           GetVideoEncoderConfig()->Copy());
     });
@@ -383,14 +382,13 @@
         << "Timed out waiting for all SSRCs to send packets.";
   }
 
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &send_transport, &receive_transport]() {
-             Stop();
-             DestroyStreams();
-             send_transport.reset();
-             receive_transport.reset();
-             DestroyCalls();
-           });
+  SendTask(task_queue(), [this, &send_transport, &receive_transport]() {
+    Stop();
+    DestroyStreams();
+    send_transport.reset();
+    receive_transport.reset();
+    DestroyCalls();
+  });
 }
 
 TEST_F(RtpRtcpEndToEndTest, RestartingSendStreamPreservesRtpState) {
@@ -484,7 +482,7 @@
   test::FunctionVideoEncoderFactory encoder_factory(
       []() { return VP8Encoder::Create(); });
 
-  SendTask(RTC_FROM_HERE, task_queue(), [&]() {
+  SendTask(task_queue(), [&]() {
     CreateCalls();
 
     BuiltInNetworkBehaviorConfig lossy_delayed_link;
@@ -563,7 +561,7 @@
   // Initial test.
   EXPECT_TRUE(observer.Wait()) << "Timed out waiting for packets.";
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this, &observer]() {
+  SendTask(task_queue(), [this, &observer]() {
     // Ensure monotonicity when the VideoSendStream is restarted.
     Stop();
     observer.ResetPacketCount();
@@ -572,7 +570,7 @@
 
   EXPECT_TRUE(observer.Wait()) << "Timed out waiting for packets.";
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this, &observer]() {
+  SendTask(task_queue(), [this, &observer]() {
     // Ensure monotonicity when the VideoSendStream is recreated.
     DestroyVideoSendStreams();
     observer.ResetPacketCount();
@@ -584,13 +582,12 @@
   EXPECT_TRUE(observer.Wait()) << "Timed out waiting for packets.";
 
   // Cleanup.
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &send_transport, &receive_transport]() {
-             Stop();
-             DestroyStreams();
-             send_transport.reset();
-             receive_transport.reset();
-             DestroyCalls();
-           });
+  SendTask(task_queue(), [this, &send_transport, &receive_transport]() {
+    Stop();
+    DestroyStreams();
+    send_transport.reset();
+    receive_transport.reset();
+    DestroyCalls();
+  });
 }
 }  // namespace webrtc
diff --git a/video/end_to_end_tests/ssrc_tests.cc b/video/end_to_end_tests/ssrc_tests.cc
index a39e3e2..ea5a887 100644
--- a/video/end_to_end_tests/ssrc_tests.cc
+++ b/video/end_to_end_tests/ssrc_tests.cc
@@ -81,7 +81,7 @@
   std::unique_ptr<PacketInputObserver> input_observer;
 
   SendTask(
-      RTC_FROM_HERE, task_queue(),
+      task_queue(),
       [this, &send_transport, &receive_transport, &input_observer]() {
         CreateCalls();
 
@@ -117,14 +117,13 @@
   // Wait() waits for a received packet.
   EXPECT_TRUE(input_observer->Wait());
 
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &send_transport, &receive_transport]() {
-             Stop();
-             DestroyStreams();
-             send_transport.reset();
-             receive_transport.reset();
-             DestroyCalls();
-           });
+  SendTask(task_queue(), [this, &send_transport, &receive_transport]() {
+    Stop();
+    DestroyStreams();
+    send_transport.reset();
+    receive_transport.reset();
+    DestroyCalls();
+  });
 }
 
 void SsrcEndToEndTest::TestSendsSetSsrcs(size_t num_ssrcs,
@@ -203,7 +202,7 @@
 
       if (send_single_ssrc_first_) {
         // Set full simulcast and continue with the rest of the SSRCs.
-        SendTask(RTC_FROM_HERE, task_queue_, [&]() {
+        SendTask(task_queue_, [&]() {
           send_stream_->ReconfigureVideoEncoder(
               std::move(video_encoder_config_all_streams_));
         });
diff --git a/video/end_to_end_tests/stats_tests.cc b/video/end_to_end_tests/stats_tests.cc
index d1df83a..b44cc0a 100644
--- a/video/end_to_end_tests/stats_tests.cc
+++ b/video/end_to_end_tests/stats_tests.cc
@@ -145,8 +145,7 @@
       RTC_DCHECK(send_stream_);
 
       VideoSendStream::Stats stats;
-      SendTask(RTC_FROM_HERE, task_queue_,
-               [&]() { stats = send_stream_->GetStats(); });
+      SendTask(task_queue_, [&]() { stats = send_stream_->GetStats(); });
 
       size_t expected_num_streams =
           kNumSimulcastStreams + expected_send_ssrcs_.size();
@@ -299,8 +298,7 @@
 
       while (now_ms < stop_time_ms) {
         if (!receive_ok && task_queue_) {
-          SendTask(RTC_FROM_HERE, task_queue_,
-                   [&]() { receive_ok = CheckReceiveStats(); });
+          SendTask(task_queue_, [&]() { receive_ok = CheckReceiveStats(); });
         }
         if (!send_ok)
           send_ok = CheckSendStats();
@@ -375,7 +373,7 @@
 
     void PerformTest() override {
       // No frames reported initially.
-      SendTask(RTC_FROM_HERE, task_queue_, [&]() {
+      SendTask(task_queue_, [&]() {
         for (const auto& receive_stream : receive_streams_) {
           EXPECT_FALSE(receive_stream->GetStats().timing_frame_info);
         }
@@ -383,7 +381,7 @@
       // Wait for at least one timing frame to be sent with 100ms grace period.
       SleepMs(kDefaultTimingFramesDelayMs + 100);
       // Check that timing frames are reported for each stream.
-      SendTask(RTC_FROM_HERE, task_queue_, [&]() {
+      SendTask(task_queue_, [&]() {
         for (const auto& receive_stream : receive_streams_) {
           EXPECT_TRUE(receive_stream->GetStats().timing_frame_info);
         }
@@ -507,9 +505,8 @@
   VideoEncoderConfig encoder_config_with_screenshare;
 
   SendTask(
-      RTC_FROM_HERE, task_queue(),
-      [this, &test, &send_config, &recv_config,
-       &encoder_config_with_screenshare]() {
+      task_queue(), [this, &test, &send_config, &recv_config,
+                     &encoder_config_with_screenshare]() {
         CreateSenderCall(send_config);
         CreateReceiverCall(recv_config);
 
@@ -547,18 +544,17 @@
   test.PerformTest();
 
   // Replace old send stream.
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &encoder_config_with_screenshare]() {
-             DestroyVideoSendStreams();
-             CreateVideoSendStream(encoder_config_with_screenshare);
-             SetVideoDegradation(DegradationPreference::BALANCED);
-             GetVideoSendStream()->Start();
-           });
+  SendTask(task_queue(), [this, &encoder_config_with_screenshare]() {
+    DestroyVideoSendStreams();
+    CreateVideoSendStream(encoder_config_with_screenshare);
+    SetVideoDegradation(DegradationPreference::BALANCED);
+    GetVideoSendStream()->Start();
+  });
 
   // Continue to run test but now with screenshare.
   test.PerformTest();
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     Stop();
     DestroyStreams();
     send_transport_.reset();
@@ -700,7 +696,7 @@
   std::unique_ptr<test::DirectTransport> sender_transport;
   std::unique_ptr<test::DirectTransport> receiver_transport;
 
-  SendTask(RTC_FROM_HERE, task_queue(),
+  SendTask(task_queue(),
            [this, &sender_transport, &receiver_transport]() {
              BuiltInNetworkBehaviorConfig config;
              config.queue_delay_ms = kSendDelayMs;
@@ -733,7 +729,7 @@
   int64_t start_time_ms = clock_->TimeInMilliseconds();
   while (true) {
     Call::Stats stats;
-    SendTask(RTC_FROM_HERE, task_queue(),
+    SendTask(task_queue(),
              [this, &stats]() { stats = sender_call_->GetStats(); });
     ASSERT_GE(start_time_ms + kDefaultTimeoutMs, clock_->TimeInMilliseconds())
         << "No RTT stats before timeout!";
@@ -747,13 +743,12 @@
     SleepMs(10);
   }
 
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &sender_transport, &receiver_transport]() {
-             Stop();
-             DestroyStreams();
-             sender_transport.reset();
-             receiver_transport.reset();
-             DestroyCalls();
-           });
+  SendTask(task_queue(), [this, &sender_transport, &receiver_transport]() {
+    Stop();
+    DestroyStreams();
+    sender_transport.reset();
+    receiver_transport.reset();
+    DestroyCalls();
+  });
 }
 }  // namespace webrtc
diff --git a/video/picture_id_tests.cc b/video/picture_id_tests.cc
index 85b7f8a..7d0a076 100644
--- a/video/picture_id_tests.cc
+++ b/video/picture_id_tests.cc
@@ -217,7 +217,7 @@
   PictureIdTest() : num_temporal_layers_(GetParam()) {}
 
   virtual ~PictureIdTest() {
-    SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+    SendTask(task_queue(), [this]() {
       send_transport_.reset();
       receive_transport_.reset();
       DestroyCalls();
@@ -254,7 +254,7 @@
       new PictureIdObserver(PayloadStringToCodecType(payload_name)));
 
   SendTask(
-      RTC_FROM_HERE, task_queue(), [this, encoder_factory, payload_name]() {
+      task_queue(), [this, encoder_factory, payload_name]() {
         CreateCalls();
 
         send_transport_.reset(new test::PacketTransport(
@@ -299,7 +299,7 @@
 
 void PictureIdTest::TestPictureIdContinuousAfterReconfigure(
     const std::vector<int>& ssrc_counts) {
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     CreateVideoStreams();
     CreateFrameGeneratorCapturer(kFrameRate, kFrameMaxWidth, kFrameMaxHeight);
 
@@ -317,14 +317,14 @@
     observer_->SetExpectedSsrcs(ssrc_count);
     observer_->ResetObservedSsrcs();
     // Make sure the picture_id sequence is continuous on reinit and recreate.
-    SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+    SendTask(task_queue(), [this]() {
       GetVideoSendStream()->ReconfigureVideoEncoder(
           GetVideoEncoderConfig()->Copy());
     });
     EXPECT_TRUE(observer_->Wait()) << "Timed out waiting for packets.";
   }
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     Stop();
     DestroyStreams();
   });
@@ -332,7 +332,7 @@
 
 void PictureIdTest::TestPictureIdIncreaseAfterRecreateStreams(
     const std::vector<int>& ssrc_counts) {
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     CreateVideoStreams();
     CreateFrameGeneratorCapturer(kFrameRate, kFrameMaxWidth, kFrameMaxHeight);
 
@@ -347,7 +347,7 @@
   // with it, therefore it is expected that some frames might be lost.
   observer_->SetMaxExpectedPictureIdGap(kMaxFramesLost);
   for (int ssrc_count : ssrc_counts) {
-    SendTask(RTC_FROM_HERE, task_queue(), [this, &ssrc_count]() {
+    SendTask(task_queue(), [this, &ssrc_count]() {
       DestroyVideoSendStreams();
 
       SetVideoEncoderConfig(ssrc_count);
@@ -362,7 +362,7 @@
     EXPECT_TRUE(observer_->Wait()) << "Timed out waiting for packets.";
   }
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     Stop();
     DestroyStreams();
   });
diff --git a/video/video_analyzer.cc b/video/video_analyzer.cc
index 311fd31..7e533ee 100644
--- a/video/video_analyzer.cc
+++ b/video/video_analyzer.cc
@@ -397,7 +397,7 @@
   if (iteration > 0)
     printf("- Farewell, sweet Concorde!\n");
 
-  SendTask(RTC_FROM_HERE, task_queue_, [&] { stats_polling_task.Stop(); });
+  SendTask(task_queue_, [&] { stats_polling_task.Stop(); });
 
   PrintResults();
   if (graph_data_output_file_)
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index 087eb3c..1b5b3a8 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -278,7 +278,7 @@
 
   while (!_kbhit() || _getch() != '\r') {
     // Drive the message loop for the thread running the task_queue
-    SendTask(RTC_FROM_HERE, task_queue, [&]() {
+    SendTask(task_queue, [&]() {
       MSG msg;
       if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
         TranslateMessage(&msg);
@@ -1237,20 +1237,19 @@
     recv_event_log_ = std::make_unique<RtcEventLogNull>();
   }
 
-  SendTask(RTC_FROM_HERE, task_queue(),
-           [this, &params, &send_transport, &recv_transport]() {
-             Call::Config send_call_config(send_event_log_.get());
-             Call::Config recv_call_config(recv_event_log_.get());
-             send_call_config.bitrate_config = params.call.call_bitrate_config;
-             recv_call_config.bitrate_config = params.call.call_bitrate_config;
-             if (params_.audio.enabled)
-               InitializeAudioDevice(&send_call_config, &recv_call_config,
-                                     params_.audio.use_real_adm);
+  SendTask(task_queue(), [this, &params, &send_transport, &recv_transport]() {
+    Call::Config send_call_config(send_event_log_.get());
+    Call::Config recv_call_config(recv_event_log_.get());
+    send_call_config.bitrate_config = params.call.call_bitrate_config;
+    recv_call_config.bitrate_config = params.call.call_bitrate_config;
+    if (params_.audio.enabled)
+      InitializeAudioDevice(&send_call_config, &recv_call_config,
+                            params_.audio.use_real_adm);
 
-             CreateCalls(send_call_config, recv_call_config);
-             send_transport = CreateSendTransport();
-             recv_transport = CreateReceiveTransport();
-           });
+    CreateCalls(send_call_config, recv_call_config);
+    send_transport = CreateSendTransport();
+    recv_transport = CreateReceiveTransport();
+  });
 
   std::string graph_title = params_.analyzer.graph_title;
   if (graph_title.empty())
@@ -1273,7 +1272,7 @@
       is_quick_test_enabled, clock_, params_.logging.rtp_dump_name,
       task_queue());
 
-  SendTask(RTC_FROM_HERE, task_queue(), [&]() {
+  SendTask(task_queue(), [&]() {
     analyzer_->SetCall(sender_call_.get());
     analyzer_->SetReceiver(receiver_call_->Receiver());
     send_transport->SetReceiver(analyzer_.get());
@@ -1319,7 +1318,7 @@
 
   analyzer_->Wait();
 
-  SendTask(RTC_FROM_HERE, task_queue(), [&]() {
+  SendTask(task_queue(), [&]() {
     StopThumbnails();
     Stop();
 
@@ -1461,7 +1460,7 @@
     recv_event_log_ = std::make_unique<RtcEventLogNull>();
   }
 
-  SendTask(RTC_FROM_HERE, task_queue(), [&]() {
+  SendTask(task_queue(), [&]() {
     params_ = params;
     CheckParamsAndInjectionComponents();
 
@@ -1550,7 +1549,7 @@
 
   PressEnterToContinue(task_queue());
 
-  SendTask(RTC_FROM_HERE, task_queue(), [&]() {
+  SendTask(task_queue(), [&]() {
     Stop();
     DestroyStreams();
 
diff --git a/video/video_send_stream_impl_unittest.cc b/video/video_send_stream_impl_unittest.cc
index ac7ea21..2d334b1 100644
--- a/video/video_send_stream_impl_unittest.cc
+++ b/video/video_send_stream_impl_unittest.cc
@@ -195,14 +195,11 @@
             EXPECT_EQ(config.enforce_min_bitrate, !kSuspend);
             EXPECT_EQ(config.bitrate_priority, kDefaultBitratePriority);
           }));
-  test_queue_.SendTask(
-      [&] {
-        vss_impl->Start();
-        EXPECT_CALL(bitrate_allocator_, RemoveObserver(vss_impl.get()))
-            .Times(1);
-        vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+  test_queue_.SendTask([&] {
+    vss_impl->Start();
+    EXPECT_CALL(bitrate_allocator_, RemoveObserver(vss_impl.get())).Times(1);
+    vss_impl->Stop();
+  });
 }
 
 TEST_F(VideoSendStreamImplTest, UpdatesObserverOnConfigurationChange) {
@@ -267,8 +264,7 @@
                 VideoEncoderConfig::ContentType::kRealtimeVideo,
                 min_transmit_bitrate_bps);
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest, UpdatesObserverOnConfigurationChangeWithAlr) {
@@ -335,8 +331,7 @@
                 VideoEncoderConfig::ContentType::kScreen,
                 min_transmit_bitrate_bps);
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest,
@@ -398,8 +393,7 @@
                 VideoEncoderConfig::ContentType::kRealtimeVideo,
                 /*min_transmit_bitrate_bps=*/0);
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest, SetsScreensharePacingFactorWithFeedback) {
@@ -414,12 +408,10 @@
   auto vss_impl = CreateVideoSendStreamImpl(
       kDefaultInitialBitrateBps, kDefaultBitratePriority,
       VideoEncoderConfig::ContentType::kScreen);
-  test_queue_.SendTask(
-      [&] {
-        vss_impl->Start();
-        vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+  test_queue_.SendTask([&] {
+    vss_impl->Start();
+    vss_impl->Stop();
+  });
 }
 
 TEST_F(VideoSendStreamImplTest, DoesNotSetPacingFactorWithoutFeedback) {
@@ -427,13 +419,11 @@
   auto vss_impl = CreateVideoSendStreamImpl(
       kDefaultInitialBitrateBps, kDefaultBitratePriority,
       VideoEncoderConfig::ContentType::kScreen);
-  test_queue_.SendTask(
-      [&] {
-        EXPECT_CALL(transport_controller_, SetPacingFactor(_)).Times(0);
-        vss_impl->Start();
-        vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+  test_queue_.SendTask([&] {
+    EXPECT_CALL(transport_controller_, SetPacingFactor(_)).Times(0);
+    vss_impl->Start();
+    vss_impl->Stop();
+  });
 }
 
 TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationWhenEnabled) {
@@ -482,8 +472,7 @@
         sink->OnBitrateAllocationUpdated(alloc);
 
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest, ThrottlesVideoBitrateAllocationWhenTooSimilar) {
@@ -542,8 +531,7 @@
         sink->OnBitrateAllocationUpdated(updated_alloc);
 
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationOnLayerChange) {
@@ -588,8 +576,7 @@
         sink->OnBitrateAllocationUpdated(updated_alloc);
 
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationAfterTimeout) {
@@ -686,8 +673,7 @@
         }
 
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest, CallsVideoStreamEncoderOnBitrateUpdate) {
@@ -790,8 +776,7 @@
                     OnBitrateUpdated(DataRate::Zero(), DataRate::Zero(),
                                      DataRate::Zero(), 0, 0, 0));
         vss_impl->Stop();
-      },
-      RTC_FROM_HERE);
+      });
 }
 
 TEST_F(VideoSendStreamImplTest, DisablesPaddingOnPausedEncoder) {
@@ -863,8 +848,7 @@
             ->OnEncodedImage(encoded_image, &codec_specific);
         // Only after actual frame is encoded are we enabling the padding.
         EXPECT_GT(padding_bitrate, 0);
-      },
-      RTC_FROM_HERE);
+      });
 
   rtc::Event done;
   test_queue_.Get()->PostDelayedTask(
@@ -901,8 +885,7 @@
                 EncodedImageCallback::DropReason::kDroppedByEncoder);
         EXPECT_CALL(bitrate_allocator_, RemoveObserver(vss_impl.get()))
             .Times(0);
-      },
-      RTC_FROM_HERE);
+      });
 
   rtc::Event done;
   test_queue_.Get()->PostDelayedTask(
@@ -1025,8 +1008,7 @@
           ::testing::Mock::VerifyAndClearExpectations(&bitrate_allocator_);
 
           vss_impl->Stop();
-        },
-        RTC_FROM_HERE);
+        });
   }
 }
 }  // namespace internal
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index 541d40b..8bdad74 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -151,7 +151,7 @@
 };
 
 TEST_F(VideoSendStreamTest, CanStartStartedStream) {
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     CreateSenderCall();
 
     test::NullTransport transport;
@@ -165,7 +165,7 @@
 }
 
 TEST_F(VideoSendStreamTest, CanStopStoppedStream) {
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     CreateSenderCall();
 
     test::NullTransport transport;
@@ -1593,7 +1593,7 @@
     ~ChangingNetworkRouteTest() {
       // Block until all already posted tasks run to avoid 'use after free'
       // when such task accesses `this`.
-      SendTask(RTC_FROM_HERE, task_queue_, [] {});
+      SendTask(task_queue_, [] {});
     }
 
     void OnCallsCreated(Call* sender_call, Call* receiver_call) override {
@@ -1651,7 +1651,7 @@
       new_route.remote = rtc::RouteEndpoint::CreateWithNetworkId(20);
       BitrateConstraints bitrate_config;
 
-      SendTask(RTC_FROM_HERE, task_queue_,
+      SendTask(task_queue_,
                [this, &new_route, &bitrate_config]() {
                  RTC_DCHECK_RUN_ON(&task_queue_thread_);
                  call_->GetTransportControllerSend()->OnNetworkRouteChanged(
@@ -1665,7 +1665,7 @@
           << "Timed out while waiting for start bitrate to be exceeded.";
 
       SendTask(
-          RTC_FROM_HERE, task_queue_, [this, &new_route, &bitrate_config]() {
+          task_queue_, [this, &new_route, &bitrate_config]() {
             RTC_DCHECK_RUN_ON(&task_queue_thread_);
             bitrate_config.start_bitrate_bps = -1;
             bitrate_config.max_bitrate_bps = kNewMaxBitrateBps;
@@ -1719,7 +1719,7 @@
     ~RelayToDirectRouteTest() {
       // Block until all already posted tasks run to avoid 'use after free'
       // when such task accesses `this`.
-      SendTask(RTC_FROM_HERE, task_queue_, [] {});
+      SendTask(task_queue_, [] {});
     }
 
     void OnCallsCreated(Call* sender_call, Call* receiver_call) override {
@@ -1755,7 +1755,7 @@
       route.local = rtc::RouteEndpoint::CreateWithNetworkId(10);
       route.remote = rtc::RouteEndpoint::CreateWithNetworkId(20);
 
-      SendTask(RTC_FROM_HERE, task_queue_, [this, &route]() {
+      SendTask(task_queue_, [this, &route]() {
         RTC_DCHECK_RUN_ON(&task_queue_thread_);
         relayed_phase_ = true;
         route.remote = route.remote.CreateWithTurn(true);
@@ -1771,7 +1771,7 @@
       EXPECT_TRUE(Wait())
           << "Timeout waiting for sufficient packets sent count.";
 
-      SendTask(RTC_FROM_HERE, task_queue_, [this, &route]() {
+      SendTask(task_queue_, [this, &route]() {
         RTC_DCHECK_RUN_ON(&task_queue_thread_);
         EXPECT_LE(call_->GetStats().send_bandwidth_bps, kRelayBandwidthCapBps);
 
@@ -1829,7 +1829,7 @@
     }
 
     void PerformTest() override {
-      SendTask(RTC_FROM_HERE, task_queue_, [this]() {
+      SendTask(task_queue_, [this]() {
         transport_overhead_ = 100;
         call_->GetTransportControllerSend()->OnTransportOverheadChanged(
             transport_overhead_);
@@ -1842,7 +1842,7 @@
         packets_sent_ = 0;
       }
 
-      SendTask(RTC_FROM_HERE, task_queue_, [this]() {
+      SendTask(task_queue_, [this]() {
         transport_overhead_ = 500;
         call_->GetTransportControllerSend()->OnTransportOverheadChanged(
             transport_overhead_);
@@ -1890,7 +1890,7 @@
   ~MaxPaddingSetTest() {
     // Block until all already posted tasks run to avoid 'use after free'
     // when such task accesses `this`.
-    SendTask(RTC_FROM_HERE, task_queue_, [] {});
+    SendTask(task_queue_, [] {});
   }
 
   void ModifyVideoConfigs(
@@ -2071,7 +2071,7 @@
   EncoderObserver encoder;
   test::VideoEncoderProxyFactory encoder_factory(&encoder);
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this, &transport, &encoder_factory]() {
+  SendTask(task_queue(), [this, &transport, &encoder_factory]() {
     CreateSenderCall();
     CreateSendConfig(1, 0, 0, &transport);
     GetVideoSendConfig()->encoder_settings.encoder_factory = &encoder_factory;
@@ -2083,14 +2083,14 @@
 
   encoder.WaitForResolution(kDefaultWidth, kDefaultHeight);
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     frame_generator_capturer_->ChangeResolution(kDefaultWidth * 2,
                                                 kDefaultHeight * 2);
   });
 
   encoder.WaitForResolution(kDefaultWidth * 2, kDefaultHeight * 2);
 
-  SendTask(RTC_FROM_HERE, task_queue(), [this]() {
+  SendTask(task_queue(), [this]() {
     DestroyStreams();
     DestroyCalls();
   });
@@ -2325,7 +2325,7 @@
     void PerformTest() override {
       EXPECT_TRUE(Wait()) << "Timed out while waiting for Encode.";
 
-      SendTask(RTC_FROM_HERE, task_queue_, [this]() {
+      SendTask(task_queue_, [this]() {
         EXPECT_EQ(0u, num_releases());
         stream_->ReconfigureVideoEncoder(std::move(encoder_config_));
         EXPECT_EQ(0u, num_releases());
@@ -2418,7 +2418,7 @@
     // Change encoder settings to actually trigger reconfiguration.
     encoder_config_.frame_drop_enabled = !encoder_config_.frame_drop_enabled;
     encoder_config_.encoder_specific_settings = GetEncoderSpecificSettings();
-    SendTask(RTC_FROM_HERE, task_queue_, [&]() {
+    SendTask(task_queue_, [&]() {
       stream_->ReconfigureVideoEncoder(std::move(encoder_config_));
     });
     ASSERT_TRUE(
@@ -2835,14 +2835,14 @@
       BitrateConstraints bitrate_config;
       bitrate_config.start_bitrate_bps = kIncreasedStartBitrateKbps * 1000;
       bitrate_config.max_bitrate_bps = kIncreasedMaxBitrateKbps * 1000;
-      SendTask(RTC_FROM_HERE, task_queue_, [this, &bitrate_config]() {
+      SendTask(task_queue_, [this, &bitrate_config]() {
         call_->GetTransportControllerSend()->SetSdpBitrateParameters(
             bitrate_config);
       });
       // Encoder rate is capped by EncoderConfig max_bitrate_bps.
       WaitForSetRates(kMaxBitrateKbps);
       encoder_config_.max_bitrate_bps = kLowerMaxBitrateKbps * 1000;
-      SendTask(RTC_FROM_HERE, task_queue_, [&]() {
+      SendTask(task_queue_, [&]() {
         send_stream_->ReconfigureVideoEncoder(encoder_config_.Copy());
       });
       ASSERT_TRUE(create_rate_allocator_event_.Wait(
@@ -2854,7 +2854,7 @@
       EXPECT_EQ(1, num_encoder_initializations_);
 
       encoder_config_.max_bitrate_bps = kIncreasedMaxBitrateKbps * 1000;
-      SendTask(RTC_FROM_HERE, task_queue_, [&]() {
+      SendTask(task_queue_, [&]() {
         send_stream_->ReconfigureVideoEncoder(encoder_config_.Copy());
       });
       ASSERT_TRUE(create_rate_allocator_event_.Wait(
@@ -2951,8 +2951,7 @@
       EXPECT_TRUE(Wait())
           << "Timed out while waiting for the encoder to send one frame.";
       VideoSendStream::Stats stats;
-      SendTask(RTC_FROM_HERE, task_queue_,
-               [&]() { stats = send_stream_->GetStats(); });
+      SendTask(task_queue_, [&]() { stats = send_stream_->GetStats(); });
 
       for (size_t i = 0; i < kNumStreams; ++i) {
         ASSERT_TRUE(stats.substreams.find(kVideoSendSsrcs[i]) !=
@@ -3728,7 +3727,7 @@
       bitrate_config.start_bitrate_bps = kStartBitrateBps;
       bitrate_config.max_bitrate_bps = kMaxBitrateBps;
       bitrate_config.min_bitrate_bps = kMinBitrateBps;
-      SendTask(RTC_FROM_HERE, task_queue_, [this, &bitrate_config]() {
+      SendTask(task_queue_, [this, &bitrate_config]() {
         call_->GetTransportControllerSend()->SetSdpBitrateParameters(
             bitrate_config);
         call_->GetTransportControllerSend()->OnTransportOverheadChanged(40);
@@ -3985,7 +3984,7 @@
   auto reset_fun = [this](const VideoSendStream::Config& send_stream_config,
                           const VideoEncoderConfig& encoder_config,
                           test::BaseTest* test) {
-    SendTask(RTC_FROM_HERE, task_queue(),
+    SendTask(task_queue(),
              [this, &send_stream_config, &encoder_config, &test]() {
                Stop();
                DestroyVideoSendStreams();
