Thread-checkers for PeerConnectionFactory::worker_thread_
Add RTC_DCHECKs that would ensure that PeerConnectionFactory::X_w() functions, intended to run on the worker_thread_, do so.
BUG=None
Review-Url: https://codereview.webrtc.org/3007153006
Cr-Original-Commit-Position: refs/heads/master@{#19720}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 591753bf1a4db26f5b36ac9ddc1465f05c8e3f2c
diff --git a/pc/peerconnectionfactory.cc b/pc/peerconnectionfactory.cc
index 6da4669..2ff95f7 100644
--- a/pc/peerconnectionfactory.cc
+++ b/pc/peerconnectionfactory.cc
@@ -333,12 +333,15 @@
}
std::unique_ptr<RtcEventLog> PeerConnectionFactory::CreateRtcEventLog_w() {
+ RTC_DCHECK_RUN_ON(worker_thread_);
return event_log_factory_ ? event_log_factory_->CreateRtcEventLog()
: rtc::MakeUnique<RtcEventLogNullImpl>();
}
std::unique_ptr<Call> PeerConnectionFactory::CreateCall_w(
RtcEventLog* event_log) {
+ RTC_DCHECK_RUN_ON(worker_thread_);
+
const int kMinBandwidthBps = 30000;
const int kStartBandwidthBps = 300000;
const int kMaxBandwidthBps = 2000000;