Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Issue 2363673002: Promise-based RTCPeerConnection::getStats implementation. (Closed)

Created:
4 years, 3 months ago by hbos_chromium
Modified:
4 years, 2 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, einbinder+watch-test-runner_chromium.org, feature-media-reviews_chromium.org, jam, jochen+watch_chromium.org, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, posciak+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Promise-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… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+493 lines, -24 lines) Patch
M chrome/browser/media/webrtc/webrtc_browsertest.cc View 2 chunks +20 lines, -2 lines 0 comments Download
M chrome/browser/media/webrtc/webrtc_browsertest_base.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/media/webrtc/webrtc_browsertest_base.cc View 1 chunk +8 lines, -1 line 0 comments Download
A chrome/test/data/webrtc/peerconnection_getstats.js View 1 chunk +46 lines, -0 lines 0 comments Download
M chrome/test/data/webrtc/webrtc_jsep01_test.html View 1 chunk +1 line, -0 lines 0 comments Download
M components/test_runner/mock_webrtc_peer_connection_handler.cc View 1 2 2 chunks +141 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getStats-promise.html View 4 chunks +40 lines, -15 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/modules_idl_files.gni View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp View 1 3 chunks +30 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h View 1 1 chunk +40 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.cpp View 1 2 1 chunk +142 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (18 generated)
hbos_chromium
Please take a look, hta, phoglund and mkwst. (hta: getStats spec author, phoglund/mkwst: owners)
4 years, 2 months ago (2016-09-26 08:52:47 UTC) #8
phoglund_chromium
lgtm for tests
4 years, 2 months ago (2016-09-26 10:49:19 UTC) #9
hbos_chromium
Please take a look, hta and mkwst.
4 years, 2 months ago (2016-09-26 11:23:16 UTC) #10
hta - Chromium
lgtm Comments are minor. https://codereview.chromium.org/2363673002/diff/80001/components/test_runner/mock_webrtc_peer_connection_handler.cc File components/test_runner/mock_webrtc_peer_connection_handler.cc (right): https://codereview.chromium.org/2363673002/diff/80001/components/test_runner/mock_webrtc_peer_connection_handler.cc#newcode115 components/test_runner/mock_webrtc_peer_connection_handler.cc:115: return WebVector<T>(vec); I think you ...
4 years, 2 months ago (2016-09-26 13:21:13 UTC) #11
hbos_chromium
Please take a look, mkwst. https://codereview.chromium.org/2363673002/diff/80001/components/test_runner/mock_webrtc_peer_connection_handler.cc File components/test_runner/mock_webrtc_peer_connection_handler.cc (right): https://codereview.chromium.org/2363673002/diff/80001/components/test_runner/mock_webrtc_peer_connection_handler.cc#newcode115 components/test_runner/mock_webrtc_peer_connection_handler.cc:115: return WebVector<T>(vec); On 2016/09/26 ...
4 years, 2 months ago (2016-09-26 14:00:16 UTC) #12
Mike West
Implementation looks reasonable, one question below: https://codereview.chromium.org/2363673002/diff/100001/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl File third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl (right): https://codereview.chromium.org/2363673002/diff/100001/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl#newcode7 third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl:7: readonly maplike<DOMString, object>; ...
4 years, 2 months ago (2016-09-27 08:10:47 UTC) #15
hbos_chromium
https://codereview.chromium.org/2363673002/diff/100001/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl File third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl (right): https://codereview.chromium.org/2363673002/diff/100001/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl#newcode7 third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl:7: readonly maplike<DOMString, object>; On 2016/09/27 08:10:47, Mike West (OOO ...
4 years, 2 months ago (2016-09-27 08:38:39 UTC) #16
Mike West
LGTM, thanks for sending the intent.
4 years, 2 months ago (2016-09-28 08:36:07 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2363673002/120001
4 years, 2 months ago (2016-09-28 08:41:18 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/268439)
4 years, 2 months ago (2016-09-28 08:50:23 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2363673002/140001
4 years, 2 months ago (2016-09-28 09:02:14 UTC) #27
commit-bot: I haz the power
Committed patchset #5 (id:140001)
4 years, 2 months ago (2016-09-28 10:33:36 UTC) #29
commit-bot: I haz the power
4 years, 2 months ago (2016-09-28 10:35:43 UTC) #31
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/8966cb75fba3830252c4668fe4348b636604f372
Cr-Commit-Position: refs/heads/master@{#421491}

Powered by Google App Engine
This is Rietveld 408576698