Index: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl |
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl |
index 1afa9291abfb67d05ebca101393fbcccedb1385e..e61d1914d0491d29e9c0609ae2372549e4037383 100644 |
--- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl |
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl |
@@ -104,10 +104,20 @@ enum RTCIceConnectionState { |
// TODO(guidou): The failureCallback argument should be non-optional. |
[CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescriptionInit description, VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback); |
[CallWith=ScriptState, MeasureAs=RTCPeerConnectionAddIceCandidateLegacy] Promise<void> addIceCandidate((RTCIceCandidateInit or RTCIceCandidate) candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback); |
+ |
// TODO(guidou): The selector argument should the first (nullable, |
// non-optional) argument, and there should be a third failureCallback |
// argument. |
- [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCStatsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selector); |
+ // TODO(hbos): This is the desired getStats IDL: |
+ // [CallWith=ScriptState] Promise<void> getStats(RTCStatsCallback successCallback, optional MediaStreamTrack? selector); |
+ // [CallWith=ScriptState] Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector); |
+ // But the generated V8 bindings code is unable to distinguish between the |
+ // two cases (e.g. single argument case always calls the MediaStreamTrack |
+ // version). As a workaround, in order to support both signatures |
+ // |getStats(optional any)| is used. In RTCPeerConnection.cpp we dispatch to |
+ // the correct |getStats| function based on value type. crbug.com/629068. |
+ [CallWith=ScriptState] Promise getStats(optional any value); |
+ [CallWith=ScriptState] Promise<void> getStats(RTCStatsCallback successCallback, MediaStreamTrack? selector); |
// https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api |
// TODO(guidou): The label argument should have [TreatNullAs=EmptyString] |