DescriptionPreparation CL for new Promise-based RTCPeerConnection.getStats.
The WebRTC spec defines the following getStats[1]:
partial interface RTCPeerConnection {
Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
};
interface RTCStatsReport {
readonly maplike<DOMString, object>; // object: RTCStats-derived dictionaries
};
dictionary RTCStats {
DOMHighResTimeStamp timestamp;
RTCStatsType type;
DOMString id;
};
There currently exists a callback-based getStats method and related interfaces
that are different from the spec. To not break existing usages, these will be
kept for a transition period.
Before this CL, what we call "RTCStatsReport" is something other than what the
spec refers to (and is more similar to the spec's RTCStats but different).
A big difference between old and new stats API is that the old stats are
presented as string-string maps and the new API as well defined and typed
dictionary members (each deriviation should have its own .idl file). This makes
the two APIs incompatible.
Changes:
- The old RTCStatsReport is renamed to RTCLegacyStatsReport to avoid a name
conflict for when adding the new RTCStatsReport in a follow-up CL. This should
be low-risk since its a NoInterfaceObject.
- The callback-based getStats is changed in ways necessary to support two
getStats functions. E.g. it now returns Promise<void> because the return
values both have to be Promise<Foo>.
- The promise-based getStats is added behind runtime enabled test feature
"RTCPeerConnectionNewGetStats". It is not implemented yet and always rejects
its promise for now.
- The new signature is tested in RTCPeerConnection-getStats-promise.html.
[1] https://www.w3.org/TR/2016/WD-webrtc-20160531/#sec.stats-model
BUG=627816, 629068
Committed: https://crrev.com/08fa67b0f718b342b8c47725f2018c63ade8b699
Cr-Commit-Position: refs/heads/master@{#408096}
Patch Set 1 #Patch Set 2 : Cleanup and bug referencing #Patch Set 3 : Replaced TODO /w comment what happens if function != 1 args #
Total comments: 16
Patch Set 4 : Addressed hta comments (testharness.js, updated rejections) #Patch Set 5 : Updated comment in RTCPeerConnection.idl #Patch Set 6 : Added UseCounter for the new getStats #
Total comments: 6
Patch Set 7 : Rebase with master #Patch Set 8 : Addressed hta's comments #
Total comments: 2
Patch Set 9 : Overloading getStats without custom code (bindings overload bug has been fixed) #Patch Set 10 : Rebase with master #Patch Set 11 : Rebase with master #Messages
Total messages: 47 (26 generated)
|