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

Issue 2156063002: Preparation for new Promise-based RTCPeerConnection.getStats. (Closed)

Created:
4 years, 5 months ago by hbos_chromium
Modified:
4 years, 4 months ago
CC:
blink-reviews, chromium-reviews, haraken
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Preparation 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -179 lines) Patch
A third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getStats-promise.html View 1 2 3 4 5 6 7 1 chunk +57 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/UseCounter.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/modules.gypi View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -3 lines 0 comments Download
A + third_party/WebKit/Source/modules/peerconnection/RTCLegacyStatsReport.h View 4 chunks +6 lines, -6 lines 0 comments Download
A + third_party/WebKit/Source/modules/peerconnection/RTCLegacyStatsReport.cpp View 2 chunks +6 lines, -6 lines 0 comments Download
A + third_party/WebKit/Source/modules/peerconnection/RTCLegacyStatsReport.idl View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp View 1 2 3 4 5 6 7 8 3 chunks +18 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h View 1 chunk +0 lines, -62 lines 0 comments Download
D third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.cpp View 1 chunk +0 lines, -56 lines 0 comments Download
D third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.idl View 1 chunk +0 lines, -33 lines 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCStatsResponse.h View 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCStatsResponse.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCStatsResponse.idl View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 47 (26 generated)
hbos_chromium
Please take a look, mkwst and hta. (And tommi when back from vacation.)
4 years, 5 months ago (2016-07-18 14:04:44 UTC) #7
hta - Chromium
Good to see this code! Reviewed from the back of an IETF meeting, so don't ...
4 years, 5 months ago (2016-07-19 09:56:48 UTC) #9
hbos_chromium
PTAL hta. https://codereview.chromium.org/2156063002/diff/60001/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-statsPromise.html File third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-statsPromise.html (right): https://codereview.chromium.org/2156063002/diff/60001/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-statsPromise.html#newcode4 third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-statsPromise.html:4: <script src="../../resources/js-test.js"></script> On 2016/07/19 09:56:48, hta - ...
4 years, 5 months ago (2016-07-19 13:59:35 UTC) #12
hbos_chromium
PTAL hta. I updataed the RTCPeerConnection.idl comments to be agnostic as to why it is ...
4 years, 5 months ago (2016-07-20 09:29:48 UTC) #17
hbos_chromium
+asvitkine for UserCounter.h and histograms.xml (UseCounter::count /w UseCounter::RTCPeerConnectionGetStats called from RTCPeerConnection.cpp:1025).
4 years, 5 months ago (2016-07-20 11:15:27 UTC) #19
hbos_chromium
And +bokan also for UserCounter.h and histograms.xml (UseCounter::count /w UseCounter::RTCPeerConnectionGetStats called from RTCPeerConnection.cpp:1025). (asvitkine: histograms.xml ...
4 years, 5 months ago (2016-07-20 11:28:44 UTC) #21
hbos_chromium
Oops, +bokan wasn't added. There.
4 years, 5 months ago (2016-07-20 11:30:05 UTC) #23
bokan
UseCounter.h and usage lgtm
4 years, 5 months ago (2016-07-20 12:02:00 UTC) #24
Alexei Svitkine (slow)
lgtm
4 years, 5 months ago (2016-07-20 17:44:39 UTC) #25
haraken
I might want to see a conclusion of the discussion on bug 629068 (https://bugs.chromium.org/p/chromium/issues/detail?id=629068#c9) before ...
4 years, 5 months ago (2016-07-20 17:55:24 UTC) #27
hta - Chromium
Agree that we should wait a day or two to see if Haraken's folks can ...
4 years, 5 months ago (2016-07-21 23:02:37 UTC) #28
hbos_chromium
On 2016/07/21 23:02:37, hta - Chromium wrote: > Agree that we should wait a day ...
4 years, 5 months ago (2016-07-22 15:08:20 UTC) #29
tommi (sloooow) - chröme
lgtm https://codereview.chromium.org/2156063002/diff/180001/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp File third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp (right): https://codereview.chromium.org/2156063002/diff/180001/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp#newcode970 third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp:970: return getStats(scriptState, static_cast<MediaStreamTrack*>(nullptr)); you shouldn't need to cast ...
4 years, 5 months ago (2016-07-25 08:31:18 UTC) #30
hbos_chromium
PTAL hta, mkwst (and haraken?) With the overload bug fixed (https://codereview.chromium.org/2175463002) I was able to ...
4 years, 5 months ago (2016-07-25 09:56:22 UTC) #36
hbos_chromium
Bump mkwst
4 years, 4 months ago (2016-07-26 11:50:53 UTC) #37
Mike West
LGTM. Much nicer without the custom code, thanks!
4 years, 4 months ago (2016-07-27 08:42:35 UTC) #38
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/2156063002/240001
4 years, 4 months ago (2016-07-27 10:17:36 UTC) #41
hbos_chromium
hta is OOO. I have the LGTMs, landing.
4 years, 4 months ago (2016-07-27 10:18:44 UTC) #42
commit-bot: I haz the power
Committed patchset #11 (id:240001)
4 years, 4 months ago (2016-07-27 11:40:52 UTC) #44
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/08fa67b0f718b342b8c47725f2018c63ade8b699 Cr-Commit-Position: refs/heads/master@{#408096}
4 years, 4 months ago (2016-07-27 11:42:34 UTC) #46
hta - Chromium
4 years, 4 months ago (2016-08-01 08:32:26 UTC) #47
Message was sent while issue was closed.
lgtm

post-submit lgtm.

Powered by Google App Engine
This is Rietveld 408576698