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. |