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:
committed by
WebRTC LUCI CQ
parent
b190ca9e70
commit
9e09a1f327
@ -29,7 +29,6 @@
|
||||
#include "p2p/base/p2p_constants.h"
|
||||
#include "p2p/base/port.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/thread.h"
|
||||
#include "rtc_base/trace_event.h"
|
||||
@ -77,8 +76,8 @@ RTCError JsepTransportController::SetLocalDescription(
|
||||
const cricket::SessionDescription* description) {
|
||||
TRACE_EVENT0("webrtc", "JsepTransportController::SetLocalDescription");
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
return network_thread_->Invoke<RTCError>(
|
||||
RTC_FROM_HERE, [=] { return SetLocalDescription(type, description); });
|
||||
return network_thread_->BlockingCall(
|
||||
[=] { return SetLocalDescription(type, description); });
|
||||
}
|
||||
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
@ -98,8 +97,8 @@ RTCError JsepTransportController::SetRemoteDescription(
|
||||
const cricket::SessionDescription* description) {
|
||||
TRACE_EVENT0("webrtc", "JsepTransportController::SetRemoteDescription");
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
return network_thread_->Invoke<RTCError>(
|
||||
RTC_FROM_HERE, [=] { return SetRemoteDescription(type, description); });
|
||||
return network_thread_->BlockingCall(
|
||||
[=] { return SetRemoteDescription(type, description); });
|
||||
}
|
||||
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
@ -199,8 +198,7 @@ absl::optional<rtc::SSLRole> JsepTransportController::GetDtlsRole(
|
||||
// thread during negotiations, potentially multiple times.
|
||||
// WebRtcSessionDescriptionFactory::InternalCreateAnswer is one example.
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
return network_thread_->Invoke<absl::optional<rtc::SSLRole>>(
|
||||
RTC_FROM_HERE, [&] { return GetDtlsRole(mid); });
|
||||
return network_thread_->BlockingCall([&] { return GetDtlsRole(mid); });
|
||||
}
|
||||
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
@ -215,8 +213,8 @@ absl::optional<rtc::SSLRole> JsepTransportController::GetDtlsRole(
|
||||
bool JsepTransportController::SetLocalCertificate(
|
||||
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
return network_thread_->Invoke<bool>(
|
||||
RTC_FROM_HERE, [&] { return SetLocalCertificate(certificate); });
|
||||
return network_thread_->BlockingCall(
|
||||
[&] { return SetLocalCertificate(certificate); });
|
||||
}
|
||||
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
@ -274,8 +272,7 @@ JsepTransportController::GetRemoteSSLCertChain(
|
||||
|
||||
void JsepTransportController::MaybeStartGathering() {
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
network_thread_->Invoke<void>(RTC_FROM_HERE,
|
||||
[&] { MaybeStartGathering(); });
|
||||
network_thread_->BlockingCall([&] { MaybeStartGathering(); });
|
||||
return;
|
||||
}
|
||||
|
||||
@ -301,8 +298,8 @@ RTCError JsepTransportController::AddRemoteCandidates(
|
||||
RTCError JsepTransportController::RemoveRemoteCandidates(
|
||||
const cricket::Candidates& candidates) {
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
return network_thread_->Invoke<RTCError>(
|
||||
RTC_FROM_HERE, [&] { return RemoveRemoteCandidates(candidates); });
|
||||
return network_thread_->BlockingCall(
|
||||
[&] { return RemoveRemoteCandidates(candidates); });
|
||||
}
|
||||
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
@ -361,9 +358,8 @@ bool JsepTransportController::GetStats(const std::string& transport_name,
|
||||
void JsepTransportController::SetActiveResetSrtpParams(
|
||||
bool active_reset_srtp_params) {
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
network_thread_->Invoke<void>(RTC_FROM_HERE, [=] {
|
||||
SetActiveResetSrtpParams(active_reset_srtp_params);
|
||||
});
|
||||
network_thread_->BlockingCall(
|
||||
[=] { SetActiveResetSrtpParams(active_reset_srtp_params); });
|
||||
return;
|
||||
}
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
@ -378,8 +374,7 @@ void JsepTransportController::SetActiveResetSrtpParams(
|
||||
|
||||
RTCError JsepTransportController::RollbackTransports() {
|
||||
if (!network_thread_->IsCurrent()) {
|
||||
return network_thread_->Invoke<RTCError>(
|
||||
RTC_FROM_HERE, [=] { return RollbackTransports(); });
|
||||
return network_thread_->BlockingCall([=] { return RollbackTransports(); });
|
||||
}
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
bundles_.Rollback();
|
||||
|
||||
Reference in New Issue
Block a user