Add thread safety annotations for some more PeerConnection members (part 13)

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

Bug: webrtc:9987
Change-Id: Ib0814a02bd277005c8f4c1848421b70f847b5549
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131339
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27505}
This commit is contained in:
Karl Wiberg 2019-04-08 15:36:53 +02:00 committed by Commit Bot
parent 2108cc6780
commit f73f7d684c
2 changed files with 18 additions and 9 deletions

View File

@ -5962,6 +5962,7 @@ cricket::DataChannelType PeerConnection::data_channel_type() const {
}
bool PeerConnection::IceRestartPending(const std::string& content_name) const {
RTC_DCHECK_RUN_ON(signaling_thread());
return pending_ice_restarts_.find(content_name) !=
pending_ice_restarts_.end();
}

View File

@ -275,6 +275,7 @@ class PeerConnection : public PeerConnectionInternal,
bool GetSslRole(const std::string& content_name, rtc::SSLRole* role) override;
void ReturnHistogramVeryQuicklyForTesting() {
RTC_DCHECK_RUN_ON(signaling_thread());
return_histogram_very_quickly_ = true;
}
void RequestUsagePatternReportForTesting();
@ -1303,24 +1304,31 @@ class PeerConnection : public PeerConnectionInternal,
// not set or false, SCTP is allowed (DCT_SCTP);
// 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP);
// 3. If both 1&2 are false, data channel is not allowed (DCT_NONE).
cricket::DataChannelType data_channel_type_ = cricket::DCT_NONE;
// List of content names for which the remote side triggered an ICE restart.
std::set<std::string> pending_ice_restarts_;
cricket::DataChannelType data_channel_type_ =
cricket::DCT_NONE; // TODO(bugs.webrtc.org/9987): Accessed on both
// signaling and network thread.
std::unique_ptr<WebRtcSessionDescriptionFactory> webrtc_session_desc_factory_;
// List of content names for which the remote side triggered an ICE restart.
std::set<std::string> pending_ice_restarts_
RTC_GUARDED_BY(signaling_thread());
std::unique_ptr<WebRtcSessionDescriptionFactory> webrtc_session_desc_factory_
RTC_GUARDED_BY(signaling_thread());
// Member variables for caching global options.
cricket::AudioOptions audio_options_;
cricket::VideoOptions video_options_;
cricket::AudioOptions audio_options_ RTC_GUARDED_BY(signaling_thread());
cricket::VideoOptions video_options_ RTC_GUARDED_BY(signaling_thread());
int usage_event_accumulator_ = 0;
bool return_histogram_very_quickly_ = false;
int usage_event_accumulator_ RTC_GUARDED_BY(signaling_thread()) = 0;
bool return_histogram_very_quickly_ RTC_GUARDED_BY(signaling_thread()) =
false;
// This object should be used to generate any SSRC that is not explicitly
// specified by the user (or by the remote party).
// The generator is not used directly, instead it is passed on to the
// channel manager and the session description factory.
rtc::UniqueRandomIdGenerator ssrc_generator_;
rtc::UniqueRandomIdGenerator ssrc_generator_
RTC_GUARDED_BY(signaling_thread());
};
} // namespace webrtc