Issue 214: getStats on "closed" objects

The May Editor's draft says the following about errors when calling getStats in Section 13.1:

getStats

Gathers stats for the given object and reports the result asynchronously.

When the getStats() method is invoked, the user agent must queue a task to run the following steps:

  1.  For RTCDtlsTransport.getStats(), check whether RTCDtlsTransport.start() has been called; if not, throw an InvalidStateError exception. For RTCIceTransport.getStats(), check whether RTCIceTransport.start() has been called; if not, or if RTCIceTransport.stop() has been called, throw an InvalidStateError exception. For RTCRtpSender.getStats(), check whether RTCRtpSender.send(parameters) has been called; if not, throw an InvalidStateError exception. For RTCRtpReceiver.getStats(), check whether RTCRtpReceiver.receive(parameters) has been called; if not, throw an InvalidStateError exception.

  2.  Return, but continue the following steps in the background.

  3.  Start gathering the stats.

  4.  When the relevant stats have been gathered, return a new RTCStatsReport<http://ortc.org/wp-content/uploads/2015/05/ortc.html#idl-def-RTCStatsReport> object, representing the gathered stats.

No parameters.
Return type: Promise<RTCStatsReport<http://ortc.org/wp-content/uploads/2015/05/ortc.html#idl-def-RTCStatsReport>>

[BA] The error handling in 1 seems wrong since if an object is not started, stats can still be returned (though counters might be zero and other stats might have null entries). Similarly if it is closed the stats at time of closure can be returned.
Proposal is to remove the error text so it looks like this:
13.1 Methods

getStats

Gathers stats for the given object and reports the result asynchronously. If the object has not yet begun to send or receive data, the returned stats will reflect this. If the object is in the closed state, the returned stats will reflect the stats at the time the object transitioned to the closed state.

When the getStats() method is invoked, the user agent must queue a task to run the following steps:

  1.  Let p be a new promise.

  2.  Return, but continue the following steps in the background.

  3.  Start gathering the stats.

  4.  When the relevant stats have been gathered, return a new RTCStatsReport<http://ortc.org/wp-content/uploads/2015/06/ortc.html#idl-def-RTCStatsReport> object, representing the gathered stats.

No parameters.
Return type: Promise<RTCStatsReport<http://ortc.org/wp-content/uploads/2015/06/ortc.html#idl-def-RTCStatsReport>>

Received on Monday, 22 June 2015 21:45:47 UTC