Initialize worker_thread_safety_ without BlockingCall().

Bug: webrtc:15099
Change-Id: Iac448c768fb90154fbe5b64fb12d68398a314e9a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324281
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41009}
This commit is contained in:
Tommi 2023-10-24 23:49:31 +02:00 committed by WebRTC LUCI CQ
parent 8da5953fb2
commit af27d4ea38

View File

@ -639,6 +639,9 @@ PeerConnection::PeerConnection(
ice_transport_factory_(std::move(dependencies.ice_transport_factory)),
tls_cert_verifier_(std::move(dependencies.tls_cert_verifier)),
call_(std::move(call)),
worker_thread_safety_(PendingTaskSafetyFlag::CreateAttachedToTaskQueue(
/*alive=*/call_ != nullptr,
worker_thread())),
call_ptr_(call_.get()),
// RFC 3264: The numeric value of the session id and version in the
// o line MUST be representable with a "64 bit signed integer".
@ -648,14 +651,7 @@ PeerConnection::PeerConnection(
dtls_enabled_(dtls_enabled),
data_channel_controller_(this),
message_handler_(signaling_thread()),
weak_factory_(this) {
worker_thread()->BlockingCall([this] {
RTC_DCHECK_RUN_ON(worker_thread());
worker_thread_safety_ = PendingTaskSafetyFlag::Create();
if (!call_)
worker_thread_safety_->SetNotAlive();
});
}
weak_factory_(this) {}
PeerConnection::~PeerConnection() {
TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection");