Add thread safety annotations for PeerConnection::*_state_

Plus all the annotations that are necessary to make things compile
again.

Bug: webrtc:9987
Change-Id: If7bbd5a468a8c50ac3cfe03cd2ed4f5b5f461195
Reviewed-on: https://webrtc-review.googlesource.com/c/123047
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26727}
This commit is contained in:
Karl Wiberg
2019-02-17 13:00:07 +01:00
committed by Commit Bot
parent e45c688e67
commit 8d2e228991
2 changed files with 16 additions and 7 deletions

View File

@ -1810,26 +1810,31 @@ void PeerConnection::GetStats(
}
PeerConnectionInterface::SignalingState PeerConnection::signaling_state() {
RTC_DCHECK_RUN_ON(signaling_thread());
return signaling_state_;
}
PeerConnectionInterface::IceConnectionState
PeerConnection::ice_connection_state() {
RTC_DCHECK_RUN_ON(signaling_thread());
return ice_connection_state_;
}
PeerConnectionInterface::IceConnectionState
PeerConnection::standardized_ice_connection_state() {
RTC_DCHECK_RUN_ON(signaling_thread());
return standardized_ice_connection_state_;
}
PeerConnectionInterface::PeerConnectionState
PeerConnection::peer_connection_state() {
RTC_DCHECK_RUN_ON(signaling_thread());
return connection_state_;
}
PeerConnectionInterface::IceGatheringState
PeerConnection::ice_gathering_state() {
RTC_DCHECK_RUN_ON(signaling_thread());
return ice_gathering_state_;
}
@ -1975,6 +1980,7 @@ PeerConnection::GetReceivingTransceiversOfType(cricket::MediaType media_type) {
void PeerConnection::CreateAnswer(CreateSessionDescriptionObserver* observer,
const RTCOfferAnswerOptions& options) {
RTC_DCHECK_RUN_ON(signaling_thread());
TRACE_EVENT0("webrtc", "PeerConnection::CreateAnswer");
if (!observer) {
RTC_LOG(LS_ERROR) << "CreateAnswer - observer is NULL.";