Replace Thread::Invoke with Thread::BlockingCall

BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed

Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
This commit is contained in:
Danil Chapovalov
2022-09-08 18:38:10 +02:00
committed by WebRTC LUCI CQ
parent b190ca9e70
commit 9e09a1f327
54 changed files with 209 additions and 320 deletions

View File

@ -135,7 +135,7 @@ void AndroidVoipClient::Init(
// Due to consistent thread requirement on
// modules/audio_device/android/audio_device_template.h,
// code is invoked in the context of voip_thread_.
voip_thread_->Invoke<void>(RTC_FROM_HERE, [this, &config] {
voip_thread_->BlockingCall([this, &config] {
RTC_DCHECK_RUN_ON(voip_thread_.get());
supported_codecs_ = config.encoder_factory->GetSupportedEncoders();
@ -145,7 +145,7 @@ void AndroidVoipClient::Init(
}
AndroidVoipClient::~AndroidVoipClient() {
voip_thread_->Invoke<void>(RTC_FROM_HERE, [this] {
voip_thread_->BlockingCall([this] {
RTC_DCHECK_RUN_ON(voip_thread_.get());
JavaVM* jvm = nullptr;