mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 906990: Part 14. Catch exceptions thrown by getStats, since this can fail in fairly innocuous circumstances. Also, do a better job of error reporting when the stats API is used on a closed PeerConnection. r=ekr, r=jib
This commit is contained in:
parent
4fcc56263b
commit
5f879bcd8d
@ -120,8 +120,10 @@ GlobalPCList.prototype = {
|
||||
|
||||
getStatsForEachPC: function(callback, errorCallback) {
|
||||
function getStatsFromPC(pcref) {
|
||||
if (pcref.get()) {
|
||||
try {
|
||||
pcref.get().getStatsInternal(null, callback, errorCallback);
|
||||
} catch (e) {
|
||||
errorCallback("Some error getting stats from PC: " + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,6 +137,8 @@ GlobalPCList.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// TODO(bcampen@mozilla.com): Handle this with a global object in c++
|
||||
// (Bug 958221)
|
||||
getLoggingFromFirstPC: function(pattern, callback, errorCallback) {
|
||||
for (let winId in this._list) {
|
||||
this.removeNullRefs(winId);
|
||||
@ -158,6 +162,8 @@ WebrtcGlobalInformation.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports]),
|
||||
|
||||
getAllStats: function(successCallback, failureCallback) {
|
||||
// TODO(bcampen@mozilla.com): Move the work of fanout into c++, and
|
||||
// only callback once. (Bug 958221)
|
||||
if (_globalPCList) {
|
||||
_globalPCList.getStatsForEachPC(successCallback, failureCallback);
|
||||
} else {
|
||||
|
@ -1343,7 +1343,7 @@ PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector, bool internalStats) {
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::GetLogging(const nsAString& aPattern) {
|
||||
PC_AUTO_ENTER_API_CALL(true);
|
||||
PC_AUTO_ENTER_API_CALL_NO_CHECK();
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
std::string pattern(NS_ConvertUTF16toUTF8(aPattern).get());
|
||||
|
Loading…
Reference in New Issue
Block a user