From 1e1e1023800d9c007fcefac4e3d0b355d9caa0cf Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Fri, 22 Mar 2019 14:27:22 +0100 Subject: [PATCH] Add thread safety annotations for some more PeerConnection members (part 2) Plus all the annotations that were necessary to make things compile again. Bug: webrtc:9987 Change-Id: I7bd9793eb2d474f2ac7ce9e1ed590e67cc2e0a93 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128881 Reviewed-by: Steve Anton Commit-Queue: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#27255} --- pc/peer_connection.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pc/peer_connection.h b/pc/peer_connection.h index c0d3e47b5a..2d07893adc 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -512,7 +512,8 @@ class PeerConnection : public PeerConnectionInternal, rtc::scoped_refptr receiver, const std::vector& stream_ids, std::vector>* added_streams, - std::vector>* removed_streams); + std::vector>* removed_streams) + RTC_RUN_ON(signaling_thread()); // Runs the algorithm **process the removal of a remote track** specified in // the WebRTC specification. @@ -526,12 +527,14 @@ class PeerConnection : public PeerConnectionInternal, rtc::scoped_refptr> transceiver, std::vector>* remove_list, - std::vector>* removed_streams); + std::vector>* removed_streams) + RTC_RUN_ON(signaling_thread()); void RemoveRemoteStreamsIfEmpty( const std::vector>& remote_streams, - std::vector>* removed_streams); + std::vector>* removed_streams) + RTC_RUN_ON(signaling_thread()); void OnNegotiationNeeded(); @@ -1112,11 +1115,14 @@ class PeerConnection : public PeerConnectionInternal, const std::string rtcp_cname_; // Streams added via AddStream. - rtc::scoped_refptr local_streams_; + const rtc::scoped_refptr local_streams_ + RTC_GUARDED_BY(signaling_thread()); // Streams created as a result of SetRemoteDescription. - rtc::scoped_refptr remote_streams_; + const rtc::scoped_refptr remote_streams_ + RTC_GUARDED_BY(signaling_thread()); - std::vector> stream_observers_; + std::vector> stream_observers_ + RTC_GUARDED_BY(signaling_thread()); // These lists store sender info seen in local/remote descriptions. std::vector remote_audio_sender_infos_;