Added getLegacyStats until Chrome fully supports new getStats() API.

TBR=alanknight@google.com

Change-Id: Iea06485fc54cdbcb30f1cc1bf7a10f97335e242a
Reviewed-on: https://dart-review.googlesource.com/63442
Reviewed-by: Alan Knight <alanknight@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
This commit is contained in:
Terry Lucas 2018-07-02 21:28:48 +00:00 committed by commit-bot@chromium.org
parent 64641d014b
commit fd26d67a0b
3 changed files with 36 additions and 0 deletions

View file

@ -25477,6 +25477,23 @@ class RtcPeerConnection extends EventTarget {
return completer.future;
}
/**
* Temporarily exposes _getStats and old getStats as getLegacyStats until Chrome fully supports
* new getStats API.
*/
@JSName('getStats')
Future<RtcStatsResponse> getLegacyStats([MediaStreamTrack selector]) {
var completer = new Completer<RtcStatsResponse>();
_getStats((value) {
completer.complete(value);
}, selector);
return completer.future;
}
@JSName('getStats')
Future _getStats(
[RtcStatsCallback successCallback, MediaStreamTrack selector]) native;
static Future generateCertificate(/*AlgorithmIdentifier*/ keygenAlgorithm) =>
JS('dynamic', 'generateCertificate(#)', keygenAlgorithm);

View file

@ -16403,6 +16403,9 @@
"generateCertificate": {
"support_level": "untriaged"
},
"getLegacyStats": {
"support_level": "untriaged"
},
"getLocalStreams": {},
"getReceivers": {
"support_level": "untriaged"

View file

@ -50,6 +50,22 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
return completer.future;
}
/**
* Temporarily exposes _getStats and old getStats as getLegacyStats until Chrome fully supports
* new getStats API.
*/
@JSName('getStats')
Future<RtcStatsResponse> getLegacyStats([MediaStreamTrack selector]) {
var completer = new Completer<RtcStatsResponse>();
_getStats((value) {
completer.complete(value);
}, selector);
return completer.future;
}
@JSName('getStats')
Future _getStats(
[RtcStatsCallback successCallback, MediaStreamTrack selector]) native;
static Future generateCertificate(/*AlgorithmIdentifier*/ keygenAlgorithm) =>
JS('dynamic', 'generateCertificate(#)', keygenAlgorithm);