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 <steveanton@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27255}
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index c0d3e47..2d07893 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -512,7 +512,8 @@
rtc::scoped_refptr<RtpReceiverInternal> receiver,
const std::vector<std::string>& stream_ids,
std::vector<rtc::scoped_refptr<MediaStreamInterface>>* added_streams,
- std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams);
+ std::vector<rtc::scoped_refptr<MediaStreamInterface>>* 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 @@
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
transceiver,
std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>* remove_list,
- std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams);
+ std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams)
+ RTC_RUN_ON(signaling_thread());
void RemoveRemoteStreamsIfEmpty(
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&
remote_streams,
- std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams);
+ std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams)
+ RTC_RUN_ON(signaling_thread());
void OnNegotiationNeeded();
@@ -1112,11 +1115,14 @@
const std::string rtcp_cname_;
// Streams added via AddStream.
- rtc::scoped_refptr<StreamCollection> local_streams_;
+ const rtc::scoped_refptr<StreamCollection> local_streams_
+ RTC_GUARDED_BY(signaling_thread());
// Streams created as a result of SetRemoteDescription.
- rtc::scoped_refptr<StreamCollection> remote_streams_;
+ const rtc::scoped_refptr<StreamCollection> remote_streams_
+ RTC_GUARDED_BY(signaling_thread());
- std::vector<std::unique_ptr<MediaStreamObserver>> stream_observers_;
+ std::vector<std::unique_ptr<MediaStreamObserver>> stream_observers_
+ RTC_GUARDED_BY(signaling_thread());
// These lists store sender info seen in local/remote descriptions.
std::vector<RtpSenderInfo> remote_audio_sender_infos_;