From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/pc/dtls_transport.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'third_party/libwebrtc/pc/dtls_transport.h') diff --git a/third_party/libwebrtc/pc/dtls_transport.h b/third_party/libwebrtc/pc/dtls_transport.h index cca4cc980a..a1893297e6 100644 --- a/third_party/libwebrtc/pc/dtls_transport.h +++ b/third_party/libwebrtc/pc/dtls_transport.h @@ -12,6 +12,7 @@ #define PC_DTLS_TRANSPORT_H_ #include +#include #include "api/dtls_transport_interface.h" #include "api/ice_transport_interface.h" @@ -40,18 +41,22 @@ class DtlsTransport : public DtlsTransportInterface { std::unique_ptr internal); rtc::scoped_refptr ice_transport() override; + + // Currently called from the signaling thread and potentially Chromium's + // JS thread. DtlsTransportInformation Information() override; + void RegisterObserver(DtlsTransportObserverInterface* observer) override; void UnregisterObserver() override; void Clear(); cricket::DtlsTransportInternal* internal() { - MutexLock lock(&lock_); + RTC_DCHECK_RUN_ON(owner_thread_); return internal_dtls_transport_.get(); } const cricket::DtlsTransportInternal* internal() const { - MutexLock lock(&lock_); + RTC_DCHECK_RUN_ON(owner_thread_); return internal_dtls_transport_.get(); } @@ -63,12 +68,19 @@ class DtlsTransport : public DtlsTransportInterface { DtlsTransportState state); void UpdateInformation(); + // Called when changing `info_`. We only change the values from the + // `owner_thread_` (a.k.a. the network thread). + void set_info(DtlsTransportInformation&& info) RTC_RUN_ON(owner_thread_) { + MutexLock lock(&lock_); + info_ = std::move(info); + } + DtlsTransportObserverInterface* observer_ = nullptr; rtc::Thread* owner_thread_; mutable Mutex lock_; DtlsTransportInformation info_ RTC_GUARDED_BY(lock_); std::unique_ptr internal_dtls_transport_ - RTC_GUARDED_BY(lock_); + RTC_GUARDED_BY(owner_thread_); const rtc::scoped_refptr ice_transport_; }; -- cgit v1.2.3