Bug 167571

Summary: [WebRTC] RTCPeerConnection should reject getStats promise in closed state
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED INVALID    
Severity: Normal CC: adam.bergkvist, agouaillard, jonlee, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 143211    
Attachments:
Description Flags
Patch achristensen: review+

Description youenn fablet 2017-01-29 21:32:55 PST
RTCPeerConnection should reject getStats promise in closed mode
Comment 1 youenn fablet 2017-01-29 21:34:37 PST
Created attachment 300085 [details]
Patch
Comment 2 Alex Christensen 2017-01-30 15:37:34 PST
Comment on attachment 300085 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=300085&action=review

> Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:388
> +        promise.reject(Exception { INVALID_STATE_ERR, "Cannot get stats on closed state" });

Do we need a message here? "Cannot get stats on closed state" doesn't make much sense.
Comment 3 Adam Bergkvist 2017-02-09 04:47:13 PST
The getStats() method [1] doesn't specify that it should reject on closed state. I believe it's a feature that you should be able to extract the "last" stats gathered by a closed RTCPeerConnection.

[1] https://w3c.github.io/webrtc-pc/archives/20161219/webrtc.html#rtcpeerconnection-interface-extensions-2
Comment 4 Radar WebKit Bug Importer 2017-08-29 09:51:51 PDT
<rdar://problem/34134439>
Comment 5 Jon Lee 2017-08-29 15:43:59 PDT
The spec has changed since.