Stricter compile-time thread annotations in JsepTransportController
Bug: None Change-Id: I8a598b8b22e1067bb44a43f9bcaad3581484da0b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201729 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33029}
This commit is contained in:
@ -92,8 +92,10 @@ JsepTransportController::JsepTransportController(
|
|||||||
JsepTransportController::~JsepTransportController() {
|
JsepTransportController::~JsepTransportController() {
|
||||||
// Channel destructors may try to send packets, so this needs to happen on
|
// Channel destructors may try to send packets, so this needs to happen on
|
||||||
// the network thread.
|
// the network thread.
|
||||||
network_thread_->Invoke<void>(RTC_FROM_HERE,
|
network_thread_->Invoke<void>(RTC_FROM_HERE, [this] {
|
||||||
[this] { DestroyAllJsepTransports_n(); });
|
RTC_DCHECK_RUN_ON(network_thread_);
|
||||||
|
DestroyAllJsepTransports_n();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RTCError JsepTransportController::SetLocalDescription(
|
RTCError JsepTransportController::SetLocalDescription(
|
||||||
@ -104,6 +106,7 @@ RTCError JsepTransportController::SetLocalDescription(
|
|||||||
RTC_FROM_HERE, [=] { return SetLocalDescription(type, description); });
|
RTC_FROM_HERE, [=] { return SetLocalDescription(type, description); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RTC_DCHECK_RUN_ON(network_thread_);
|
||||||
if (!initial_offerer_.has_value()) {
|
if (!initial_offerer_.has_value()) {
|
||||||
initial_offerer_.emplace(type == SdpType::kOffer);
|
initial_offerer_.emplace(type == SdpType::kOffer);
|
||||||
if (*initial_offerer_) {
|
if (*initial_offerer_) {
|
||||||
@ -123,6 +126,7 @@ RTCError JsepTransportController::SetRemoteDescription(
|
|||||||
RTC_FROM_HERE, [=] { return SetRemoteDescription(type, description); });
|
RTC_FROM_HERE, [=] { return SetRemoteDescription(type, description); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RTC_DCHECK_RUN_ON(network_thread_);
|
||||||
return ApplyDescription_n(/*local=*/false, type, description);
|
return ApplyDescription_n(/*local=*/false, type, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,7 +562,6 @@ RTCError JsepTransportController::ApplyDescription_n(
|
|||||||
bool local,
|
bool local,
|
||||||
SdpType type,
|
SdpType type,
|
||||||
const cricket::SessionDescription* description) {
|
const cricket::SessionDescription* description) {
|
||||||
RTC_DCHECK_RUN_ON(network_thread_);
|
|
||||||
RTC_DCHECK(description);
|
RTC_DCHECK(description);
|
||||||
|
|
||||||
if (local) {
|
if (local) {
|
||||||
@ -955,7 +958,6 @@ RTCError JsepTransportController::MaybeCreateJsepTransport(
|
|||||||
bool local,
|
bool local,
|
||||||
const cricket::ContentInfo& content_info,
|
const cricket::ContentInfo& content_info,
|
||||||
const cricket::SessionDescription& description) {
|
const cricket::SessionDescription& description) {
|
||||||
RTC_DCHECK(network_thread_->IsCurrent());
|
|
||||||
cricket::JsepTransport* transport = GetJsepTransportByName(content_info.name);
|
cricket::JsepTransport* transport = GetJsepTransportByName(content_info.name);
|
||||||
if (transport) {
|
if (transport) {
|
||||||
return RTCError::OK();
|
return RTCError::OK();
|
||||||
|
@ -229,7 +229,8 @@ class JsepTransportController : public sigslot::has_slots<> {
|
|||||||
private:
|
private:
|
||||||
RTCError ApplyDescription_n(bool local,
|
RTCError ApplyDescription_n(bool local,
|
||||||
SdpType type,
|
SdpType type,
|
||||||
const cricket::SessionDescription* description);
|
const cricket::SessionDescription* description)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
RTCError ValidateAndMaybeUpdateBundleGroup(
|
RTCError ValidateAndMaybeUpdateBundleGroup(
|
||||||
bool local,
|
bool local,
|
||||||
SdpType type,
|
SdpType type,
|
||||||
@ -237,8 +238,10 @@ class JsepTransportController : public sigslot::has_slots<> {
|
|||||||
RTCError ValidateContent(const cricket::ContentInfo& content_info);
|
RTCError ValidateContent(const cricket::ContentInfo& content_info);
|
||||||
|
|
||||||
void HandleRejectedContent(const cricket::ContentInfo& content_info,
|
void HandleRejectedContent(const cricket::ContentInfo& content_info,
|
||||||
const cricket::SessionDescription* description);
|
const cricket::SessionDescription* description)
|
||||||
bool HandleBundledContent(const cricket::ContentInfo& content_info);
|
RTC_RUN_ON(network_thread_);
|
||||||
|
bool HandleBundledContent(const cricket::ContentInfo& content_info)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
|
|
||||||
bool SetTransportForMid(const std::string& mid,
|
bool SetTransportForMid(const std::string& mid,
|
||||||
cricket::JsepTransport* jsep_transport);
|
cricket::JsepTransport* jsep_transport);
|
||||||
@ -295,12 +298,14 @@ class JsepTransportController : public sigslot::has_slots<> {
|
|||||||
RTCError MaybeCreateJsepTransport(
|
RTCError MaybeCreateJsepTransport(
|
||||||
bool local,
|
bool local,
|
||||||
const cricket::ContentInfo& content_info,
|
const cricket::ContentInfo& content_info,
|
||||||
const cricket::SessionDescription& description);
|
const cricket::SessionDescription& description)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
|
|
||||||
void MaybeDestroyJsepTransport(const std::string& mid);
|
void MaybeDestroyJsepTransport(const std::string& mid)
|
||||||
void DestroyAllJsepTransports_n();
|
RTC_RUN_ON(network_thread_);
|
||||||
|
void DestroyAllJsepTransports_n() RTC_RUN_ON(network_thread_);
|
||||||
|
|
||||||
void SetIceRole_n(cricket::IceRole ice_role);
|
void SetIceRole_n(cricket::IceRole ice_role) RTC_RUN_ON(network_thread_);
|
||||||
|
|
||||||
cricket::IceRole DetermineIceRole(
|
cricket::IceRole DetermineIceRole(
|
||||||
cricket::JsepTransport* jsep_transport,
|
cricket::JsepTransport* jsep_transport,
|
||||||
@ -334,24 +339,33 @@ class JsepTransportController : public sigslot::has_slots<> {
|
|||||||
std::vector<cricket::DtlsTransportInternal*> GetDtlsTransports();
|
std::vector<cricket::DtlsTransportInternal*> GetDtlsTransports();
|
||||||
|
|
||||||
// Handlers for signals from Transport.
|
// Handlers for signals from Transport.
|
||||||
void OnTransportWritableState_n(rtc::PacketTransportInternal* transport);
|
void OnTransportWritableState_n(rtc::PacketTransportInternal* transport)
|
||||||
void OnTransportReceivingState_n(rtc::PacketTransportInternal* transport);
|
RTC_RUN_ON(network_thread_);
|
||||||
void OnTransportGatheringState_n(cricket::IceTransportInternal* transport);
|
void OnTransportReceivingState_n(rtc::PacketTransportInternal* transport)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
|
void OnTransportGatheringState_n(cricket::IceTransportInternal* transport)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
void OnTransportCandidateGathered_n(cricket::IceTransportInternal* transport,
|
void OnTransportCandidateGathered_n(cricket::IceTransportInternal* transport,
|
||||||
const cricket::Candidate& candidate);
|
const cricket::Candidate& candidate)
|
||||||
void OnTransportCandidateError_n(
|
RTC_RUN_ON(network_thread_);
|
||||||
cricket::IceTransportInternal* transport,
|
void OnTransportCandidateError_n(cricket::IceTransportInternal* transport,
|
||||||
const cricket::IceCandidateErrorEvent& event);
|
const cricket::IceCandidateErrorEvent& event)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
void OnTransportCandidatesRemoved_n(cricket::IceTransportInternal* transport,
|
void OnTransportCandidatesRemoved_n(cricket::IceTransportInternal* transport,
|
||||||
const cricket::Candidates& candidates);
|
const cricket::Candidates& candidates)
|
||||||
void OnTransportRoleConflict_n(cricket::IceTransportInternal* transport);
|
RTC_RUN_ON(network_thread_);
|
||||||
void OnTransportStateChanged_n(cricket::IceTransportInternal* transport);
|
void OnTransportRoleConflict_n(cricket::IceTransportInternal* transport)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
|
void OnTransportStateChanged_n(cricket::IceTransportInternal* transport)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
void OnTransportCandidatePairChanged_n(
|
void OnTransportCandidatePairChanged_n(
|
||||||
const cricket::CandidatePairChangeEvent& event);
|
const cricket::CandidatePairChangeEvent& event)
|
||||||
void UpdateAggregateStates_n();
|
RTC_RUN_ON(network_thread_);
|
||||||
|
void UpdateAggregateStates_n() RTC_RUN_ON(network_thread_);
|
||||||
|
|
||||||
void OnRtcpPacketReceived_n(rtc::CopyOnWriteBuffer* packet,
|
void OnRtcpPacketReceived_n(rtc::CopyOnWriteBuffer* packet,
|
||||||
int64_t packet_time_us);
|
int64_t packet_time_us)
|
||||||
|
RTC_RUN_ON(network_thread_);
|
||||||
|
|
||||||
void OnDtlsHandshakeError(rtc::SSLHandshakeError error);
|
void OnDtlsHandshakeError(rtc::SSLHandshakeError error);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user