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 deae54878157784616d043a995c05605b4c7ef33..2908a9c71f3517723e67e78e899c141579e7ea3f 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,15 +97,15 @@ 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 |
philipj_slow
2016/02/15 10:22:21
Oh, here's the answer to haraken@'s question too.
|
+ // having Promise-based versions requires that all overloads return Promises. |
[CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, RTCErrorCallback failureCallback, optional Dictionary rtcOfferOptions); |
// TODO(guidou): There should be no mediaConstraints argument. |
[CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, RTCErrorCallback failureCallback, optional Dictionary mediaConstraints); |
- // 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 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. |