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

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

Issue 1661493002: Add promise-based addIceCandidate, setLocalDescription and setRemoteDescription to RTCPeerConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj's comments on tests Created 4 years, 10 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/mediastream/RTCPeerConnection.idl
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl
index c9d1435a25285d842e12fb05a4d4cb69111c5b45..cb4840edadf2c191e0f9b5704d99c563e491d5fa 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl
@@ -73,16 +73,15 @@ enum RTCIceConnectionState {
] interface RTCPeerConnection : EventTarget {
// Promise<RTCSessionDescription> createOffer(optional RTCOfferOptions options);
// Promise<RTCSessionDescription> createAnswer(optional RTCAnswerOptions options);
- // Promise<void> setLocalDescription(RTCSessionDescription description);
+ [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescriptionInit description);
readonly attribute RTCSessionDescription? localDescription;
// readonly attribute RTCSessionDescription? currentLocalDescription;
// readonly attribute RTCSessionDescription? pendingLocalDescription;
- // Promise<void> setRemoteDescription(RTCSessionDescription description);
+ [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescriptionInit description);
readonly attribute RTCSessionDescription? remoteDescription;
// readonly attribute RTCSessionDescription? currentRemoteDescription;
// readonly attribute RTCSessionDescription? pendingRemoteDescription;
- // TODO(guidou): addIceCandidate() should return a Promise.
- [RaisesException] void addIceCandidate(RTCIceCandidate candidate);
+ [CallWith=ScriptState] Promise<void> addIceCandidate ((RTCIceCandidateInit or RTCIceCandidate) candidate);
readonly attribute RTCSignalingState signalingState;
readonly attribute RTCIceGatheringState iceGatheringState;
readonly attribute RTCIceConnectionState iceConnectionState;
@@ -98,17 +97,17 @@ enum RTCIceConnectionState {
// attribute EventHandler onicegatheringstatechange;
// https://w3c.github.io/webrtc-pc/#legacy-interface-extensions
+ // These methods return or will be changed to return Promise<void> because
+ // having Promise-based versions requires that all overloads return Promises.
// TODO(guidou): The failureCallback argument should be non-optional.
[CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary rtcOfferOptions);
- // TODO(guidou): None of the arguments should be optional.
- [CallWith=ExecutionContext, RaisesException] void setLocalDescription(RTCSessionDescription description, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback);
// TODO(guidou): The failureCallback argument should be non-optional, and
// there should be no mediaConstraints argument.
[CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary mediaConstraints);
- // TODO(guidou): The successCallback and failureCallback arguments should be
- // non-optional.
- [CallWith=ExecutionContext, RaisesException] void setRemoteDescription(RTCSessionDescription description, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback);
- [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCErrorCallback failureCallback);
+ [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescription description, VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback);
+ // TODO(guidou): The failureCallback argument should be non-optional.
+ [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescription description, VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback);
+ [CallWith=ScriptState] Promise<void> addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCErrorCallback failureCallback);
// TODO(guidou): The selector argument should the first (nullable,
// non-optional) argument, and there should be a third failureCallback
// argument.

Powered by Google App Engine
This is Rietveld 408576698