This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26620 - getStats should be allowed on a closed PeerConnection.
Summary: getStats should be allowed on a closed PeerConnection.
Status: RESOLVED MOVED
Alias: None
Product: WebRTC Working Group
Classification: Unclassified
Component: WebRTC API (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Varun Singh
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-20 21:37 UTC by Harald Alvestrand
Modified: 2014-10-31 18:30 UTC (History)
2 users (show)

See Also:


Attachments

Description Harald Alvestrand 2014-08-20 21:37:05 UTC
From Jan-Ivar Bruarøy:

I'd like to propose a change to getStats so that calling it on a closed PeerConnection does not throw, but instead gives you the stats at the time the PeerConnection closed.

Use-case: A webpage wants stats about the call that just terminated from the other side - e.g. how many frames dropped?

In [1] remove step 1:
>     1. If the RTCPeerConnection object's RTCPeerConnection signalingState is closed, throw an InvalidStateError exception. 

And edit step 5 (which would now be 4):

>     4. Start gathering the stats indicated by selectorArg. In case selectorArg is null, stats MUST be gathered for the whole RTCPeerConnection object. If the RTCPeerConnection object's RTCPeerConnection signalingState is closed, stats should reflect the state at or near the time that signalingState transitioned to closed.

Implementations would basically cache a final call to getStats internally as part of transitioning to closed.

.: Jan-Ivar :.

[1] http://dev.w3.org/2011/webrtc/editor/webrtc.html#methods-5
Comment 1 Harald Alvestrand 2014-10-31 18:27:31 UTC
Since we're moving the stats API to the stats document, this can be done there.

This issue should be moved to Github. Dom will.
Comment 2 Dominique Hazael-Massieux 2014-10-31 18:30:42 UTC
Filed at https://github.com/w3c/webrtc-stats/issues/3 ; closing for WebRTC