summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/pc/dtls_transport.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--third_party/libwebrtc/pc/dtls_transport.h18
1 files changed, 15 insertions, 3 deletions
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 <memory>
+#include <utility>
#include "api/dtls_transport_interface.h"
#include "api/ice_transport_interface.h"
@@ -40,18 +41,22 @@ class DtlsTransport : public DtlsTransportInterface {
std::unique_ptr<cricket::DtlsTransportInternal> internal);
rtc::scoped_refptr<IceTransportInterface> 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<cricket::DtlsTransportInternal> internal_dtls_transport_
- RTC_GUARDED_BY(lock_);
+ RTC_GUARDED_BY(owner_thread_);
const rtc::scoped_refptr<IceTransportWithPointer> ice_transport_;
};