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

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl

Issue 2156063002: Preparation for new Promise-based RTCPeerConnection.getStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed hta's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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]

Powered by Google App Engine
This is Rietveld 408576698