mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 1001959 - Give up references to NrIceMediaStream on STS instead of main. r=jib
This commit is contained in:
parent
2b39071dd1
commit
ad61a0ec58
@ -1896,6 +1896,7 @@ PeerConnectionImpl::IceGatheringStateChange(
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
static bool isDone(PCImplIceConnectionState state) {
|
||||
return state != PCImplIceConnectionState::Checking &&
|
||||
state != PCImplIceConnectionState::New;
|
||||
@ -1910,6 +1911,7 @@ static bool isFailed(PCImplIceConnectionState state) {
|
||||
return state == PCImplIceConnectionState::Failed ||
|
||||
state == PCImplIceConnectionState::Disconnected;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
PeerConnectionImpl::IceConnectionStateChange_m(PCImplIceConnectionState aState)
|
||||
@ -2185,11 +2187,6 @@ PeerConnectionImpl::ExecuteStatsQuery_s(RTCStatsQuery *query) {
|
||||
|
||||
ASSERT_ON_THREAD(query->iceCtx->thread());
|
||||
|
||||
// NrIceCtx must be destroyed on STS, so it is not safe to dispatch it back
|
||||
// to main.
|
||||
RefPtr<NrIceCtx> iceCtxTmp(query->iceCtx);
|
||||
query->iceCtx = nullptr;
|
||||
|
||||
// Gather stats from pipelines provided (can't touch mMedia + stream on STS)
|
||||
|
||||
for (size_t p = 0; p < query->pipelines.Length(); ++p) {
|
||||
@ -2333,6 +2330,11 @@ PeerConnectionImpl::ExecuteStatsQuery_s(RTCStatsQuery *query) {
|
||||
&(query->report));
|
||||
}
|
||||
|
||||
// NrIceCtx and NrIceMediaStream must be destroyed on STS, so it is not safe
|
||||
// to dispatch them back to main.
|
||||
// We clear streams first to maintain destruction order
|
||||
query->streams.Clear();
|
||||
query->iceCtx = nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user