зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1147857: followup patch to continue BuildStats cleanup r=jib
This commit is contained in:
Родитель
f3376e46f8
Коммит
17af11b276
|
@ -2810,13 +2810,6 @@ PeerConnectionImpl::BuildStatsQuery_m(
|
|||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Note: mMedia->ice_ctx() is deleted on STS thread; so make sure we grab and hold
|
||||
// a ref instead of making multiple calls. NrIceCtx uses threadsafe refcounting.
|
||||
query->iceCtx = mMedia->ice_ctx();
|
||||
if (!query->iceCtx) {
|
||||
CSFLogError(logTag, "Could not build stats query, no ice_ctx");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
if (!mThread) {
|
||||
CSFLogError(logTag, "Could not build stats query, no MainThread");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -2828,6 +2821,16 @@ PeerConnectionImpl::BuildStatsQuery_m(
|
|||
return rv;
|
||||
}
|
||||
|
||||
// Note: mMedia->ice_ctx() is deleted on STS thread; so make sure we grab and hold
|
||||
// a ref instead of making multiple calls. NrIceCtx uses threadsafe refcounting.
|
||||
// NOTE: Do this after all other failure tests, to ensure we don't
|
||||
// accidentally release the Ctx on Mainthread.
|
||||
query->iceCtx = mMedia->ice_ctx();
|
||||
if (!query->iceCtx) {
|
||||
CSFLogError(logTag, "Could not build stats query, no ice_ctx");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
// We do not use the pcHandle here, since that's risky to expose to content.
|
||||
query->report = new RTCStatsReportInternalConstruct(
|
||||
NS_ConvertASCIItoUTF16(mName.c_str()),
|
||||
|
|
|
@ -167,13 +167,18 @@ WebrtcGlobalInformation::GetAllStats(
|
|||
pcIdFilter.Value().EqualsASCII(p->second->GetIdAsAscii().c_str())) {
|
||||
if (p->second->HasMedia()) {
|
||||
queries->append(nsAutoPtr<RTCStatsQuery>(new RTCStatsQuery(true)));
|
||||
p->second->BuildStatsQuery_m(nullptr, // all tracks
|
||||
queries->back());
|
||||
if (NS_WARN_IF(NS_FAILED(p->second->BuildStatsQuery_m(nullptr, // all tracks
|
||||
queries->back())))) {
|
||||
queries->popBack();
|
||||
} else {
|
||||
MOZ_ASSERT(queries->back()->report);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!queries->empty()) {
|
||||
// CallbackObject does not support threadsafe refcounting, and must be
|
||||
// destroyed on main.
|
||||
nsMainThreadPtrHandle<WebrtcGlobalStatisticsCallback> callbackHandle(
|
||||
|
@ -184,6 +189,9 @@ WebrtcGlobalInformation::GetAllStats(
|
|||
NS_DISPATCH_NORMAL);
|
||||
|
||||
aRv = rv;
|
||||
} else {
|
||||
aRv = NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче