New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 822696 link

Starred by 9 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Deprecate and remove legacy getStats() API

Project Member Reported by hbos@chromium.org, Mar 16 2018

Issue description

This is a tracking bug for the work of deprecating and eventually removing the legacy non-spec compliant version of the getStats() API.

The legacy version is the callback-based version.
  Example: pc.getStats(r => { console.log(r); })
The spec-compliant version is the promise-based version.
  Example: pc.getStats().then(r => { console.log(r); })

The two versions return different stats in different formats.
Legacy version returns undocumented stats, many of which are implementation-specific. The spec-compliant version returns stats as documented in https://w3c.github.io/webrtc-stats/.

Timeframe TBD. The legacy API is heavily relied upon by third parties and the spec-compliant replacement. In order to deprecate the new API must be matured with processes in place, including:

- Figure out if there are any stats not implemented in new API blocking migration.
- If a dev is proposing a stat, within a reasonable time frame the dev must know what
  the next step is, i.e.
  - Create a PR on main spec, or in some cases provisional spec. And
  - Implement and expose, or
  - Implement behind flag, or
  - Implement as experimental
- Experimental stats must be possible, but isolated e.g. to Origin Trials.
- BAN adding stats to the legacy getStats() API.

Status as of this bug: Both APIs are supported. Legacy getStats() is mostly in maintenance mode, new stats are usually discouraged. Adding new stats to new API is preferred, but resources to do so is mostly deferred to devs requesting them. Origin Trial design doc WIP. Creating a "how to" for stats process on the TODO list, not started.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/03a506c47caf72e4c3583a77a53ed6dfb94b9e89

commit 03a506c47caf72e4c3583a77a53ed6dfb94b9e89
Author: Henrik Boström <hbos@chromium.org>
Date: Mon Jul 23 16:03:03 2018

Add whitelist preventing additions to legacy getStats() API.

Historically, new stats have bypassed stats OWNERs review and made it to
Chrome stable. This will cause import breakages if stats are added to
the legacy getStats() API in third_party/webrtc assuming:
1. They are present in a normal call setup, i.e. shows up in the
   scenario modelled by:
   WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsGetStatsCallback
2. The new stat does not recycle an already existing whitelisted name.

// The run was green except for unrelated failures with
// mac_chromium_rel_ng that have happened on multiple CLs
NOTRY=True

Bug: 822696
Change-Id: I2e6735ae6f1b987eb64865cb510eb65a6a1e4126
Reviewed-on: https://chromium-review.googlesource.com/1146726
Commit-Queue: Henrik Boström <hbos@chromium.org>
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577178}
[modify] https://crrev.com/03a506c47caf72e4c3583a77a53ed6dfb94b9e89/chrome/browser/media/webrtc/webrtc_browsertest_base.cc
[modify] https://crrev.com/03a506c47caf72e4c3583a77a53ed6dfb94b9e89/chrome/test/data/webrtc/peerconnection.js

FYI, the legacy callback getStats() API is being removed from Firefox in 65.
Thanks ngrunbaum! Does the Firefox legacy callback API and the Firefox promise-based API return the same set of stats?

Chrome's callback-based API returns a completely different set of stats that are non-standard which makes it harder to remove because users can't simply change the syntax of their calling-place, they get very different stats which breaks any processing they might do.
@hbos, Yes Firefox legacy callback API and the Firefox promise-based API returns the same set of stats.
Correction, it is being removed in Firefox 66. @hbos, @karthik, there are differences between the two sets of stats, but all of the information is available in both. If one coded against the results of the callback API, there definitely could be breakages when switching to the promise API.

Sign in to add a comment