DescriptionPromise-based RTCPeerConnection::getStats implementation (behind flag).
RTCStatsReport[1] added. It contains code for translating
WebRTCStatsReport and stats types[2] into stats dictionaries[3] by
looping over stats and stats members. JavaScript dictionaries are plain
javascript objects created on the fly.
RTCPeerConnection::getStats invokes the peer connection handler's
getStats and creates the RTCStatsReport in a callback and resolves the
promise.
Test related changes:
- peerconnection_getstats.js: This is a browser test that run the real
code all the way down to the WebRTC layer (no mocking on any layer).
It makes sure getStats resolves the promise and returns a non-empty
set of stats, with simple sanity check on properties that all RTCStats
dictionaries have in common.
- mock_webrtc_peer_connection_handler.cc: Mock implementation of
the handler's getStats, returning a stats object containing every type
of stats member.
- RTCPeerConnection-getStats-promise.html: A layout test that use the
mock peer connection handler. Verifies the value of each stat member.
[1] https://w3c.github.io/webrtc-pc/#rtcstatsreport-object
[2] https://cs.chromium.org/chromium/src/third_party/WebKit/public/platform/WebRTCStats.h?q=WebRTCStats.h&sq=package:chromium&dr=CSs&l=37
[3] https://w3c.github.io/webrtc-stats/
BUG=chromium:627816
Committed: https://crrev.com/8966cb75fba3830252c4668fe4348b636604f372
Cr-Commit-Position: refs/heads/master@{#421491}
Patch Set 1 #Patch Set 2 : nits (no need to rerun bots yet) #
Total comments: 4
Patch Set 3 : Addressed comments #
Total comments: 2
Patch Set 4 : Fixed virtual/stable/webexposed/global-interface-listing-expected.txt #Patch Set 5 : RTCStatsReport.idl behind getStats-flag instead of updating virtual/stable/webexposed/global-interf… #Messages
Total messages: 31 (18 generated)
|