OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 ActiveDOMObject, | 66 ActiveDOMObject, |
67 // TODO(guidou): There should only be one constructor argument, and it | 67 // TODO(guidou): There should only be one constructor argument, and it |
68 // should be optional. | 68 // should be optional. |
69 Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraint
s), | 69 Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraint
s), |
70 ConstructorCallWith=ExecutionContext, | 70 ConstructorCallWith=ExecutionContext, |
71 NoInterfaceObject, | 71 NoInterfaceObject, |
72 RaisesException=Constructor, | 72 RaisesException=Constructor, |
73 ] interface RTCPeerConnection : EventTarget { | 73 ] interface RTCPeerConnection : EventTarget { |
74 // Promise<RTCSessionDescription> createOffer(optional RTCOfferOptions optio
ns); | 74 // Promise<RTCSessionDescription> createOffer(optional RTCOfferOptions optio
ns); |
75 // Promise<RTCSessionDescription> createAnswer(optional RTCAnswerOptions opt
ions); | 75 // Promise<RTCSessionDescription> createAnswer(optional RTCAnswerOptions opt
ions); |
76 // Promise<void> setLocalDescription(RTCSessionDescription description); | 76 [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescripti
onInit description); |
77 readonly attribute RTCSessionDescription? localDescription; | 77 readonly attribute RTCSessionDescription? localDescription; |
78 // readonly attribute RTCSessionDescription? currentLocalDescription; | 78 // readonly attribute RTCSessionDescription? currentLocalDescription; |
79 // readonly attribute RTCSessionDescription? pendingLocalDescription; | 79 // readonly attribute RTCSessionDescription? pendingLocalDescription; |
80 // Promise<void> setRemoteDescription(RTCSessionDescription description); | 80 [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescript
ionInit description); |
81 readonly attribute RTCSessionDescription? remoteDescription; | 81 readonly attribute RTCSessionDescription? remoteDescription; |
82 // readonly attribute RTCSessionDescription? currentRemoteDescription; | 82 // readonly attribute RTCSessionDescription? currentRemoteDescription; |
83 // readonly attribute RTCSessionDescription? pendingRemoteDescription; | 83 // readonly attribute RTCSessionDescription? pendingRemoteDescription; |
84 // TODO(guidou): addIceCandidate() should return a Promise. | 84 [CallWith=ScriptState] Promise<void> addIceCandidate ((RTCIceCandidateInit o
r RTCIceCandidate) candidate); |
85 [RaisesException] void addIceCandidate(RTCIceCandidate candidate); | |
86 readonly attribute RTCSignalingState signalingState; | 85 readonly attribute RTCSignalingState signalingState; |
87 readonly attribute RTCIceGatheringState iceGatheringState; | 86 readonly attribute RTCIceGatheringState iceGatheringState; |
88 readonly attribute RTCIceConnectionState iceConnectionState; | 87 readonly attribute RTCIceConnectionState iceConnectionState; |
89 // readonly attribute boolean? canTrickleIceCandidates; | 88 // readonly attribute boolean? canTrickleIceCandidates; |
90 // RTCConfiguration getConfiguration(); | 89 // RTCConfiguration getConfiguration(); |
91 // void setConfiguration(RTCConfiguration configuration); | 90 // void setConfiguration(RTCConfiguration configuration); |
92 // TODO(guidou): close() should never throw an exception. | 91 // TODO(guidou): close() should never throw an exception. |
93 [RaisesException] void close(); | 92 [RaisesException] void close(); |
94 attribute EventHandler onnegotiationneeded; | 93 attribute EventHandler onnegotiationneeded; |
95 attribute EventHandler onicecandidate; | 94 attribute EventHandler onicecandidate; |
96 attribute EventHandler onsignalingstatechange; | 95 attribute EventHandler onsignalingstatechange; |
97 attribute EventHandler oniceconnectionstatechange; | 96 attribute EventHandler oniceconnectionstatechange; |
98 // attribute EventHandler onicegatheringstatechange; | 97 // attribute EventHandler onicegatheringstatechange; |
99 | 98 |
100 // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions | 99 // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions |
| 100 // These methods return or will be changed to return Promise<void> because |
| 101 // having Promise-based versions requires that all overloads return Promises
. |
101 // TODO(guidou): The failureCallback argument should be non-optional. | 102 // TODO(guidou): The failureCallback argument should be non-optional. |
102 [CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDesc
riptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback f
ailureCallback, optional Dictionary rtcOfferOptions); | 103 [CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDesc
riptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback f
ailureCallback, optional Dictionary rtcOfferOptions); |
103 // TODO(guidou): None of the arguments should be optional. | |
104 [CallWith=ExecutionContext, RaisesException] void setLocalDescription(RTCSes
sionDescription description, [Default=Undefined] optional VoidCallback successCa
llback, [Default=Undefined] optional RTCErrorCallback failureCallback); | |
105 // TODO(guidou): The failureCallback argument should be non-optional, and | 104 // TODO(guidou): The failureCallback argument should be non-optional, and |
106 // there should be no mediaConstraints argument. | 105 // there should be no mediaConstraints argument. |
107 [CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDes
criptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback
failureCallback, optional Dictionary mediaConstraints); | 106 [CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDes
criptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback
failureCallback, optional Dictionary mediaConstraints); |
108 // TODO(guidou): The successCallback and failureCallback arguments should be | 107 [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescripti
on description, VoidCallback successCallback, [Default=Undefined] optional RTCEr
rorCallback failureCallback); |
109 // non-optional. | 108 // TODO(guidou): The failureCallback argument should be non-optional. |
110 [CallWith=ExecutionContext, RaisesException] void setRemoteDescription(RTCSe
ssionDescription description, [Default=Undefined] optional VoidCallback successC
allback, [Default=Undefined] optional RTCErrorCallback failureCallback); | 109 [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescript
ion description, VoidCallback successCallback, [Default=Undefined] optional RTCE
rrorCallback failureCallback); |
111 [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallba
ck successCallback, RTCErrorCallback failureCallback); | 110 [CallWith=ScriptState] Promise<void> addIceCandidate(RTCIceCandidate candida
te, VoidCallback successCallback, RTCErrorCallback failureCallback); |
112 // TODO(guidou): The selector argument should the first (nullable, | 111 // TODO(guidou): The selector argument should the first (nullable, |
113 // non-optional) argument, and there should be a third failureCallback | 112 // non-optional) argument, and there should be a third failureCallback |
114 // argument. | 113 // argument. |
115 [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCSt
atsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selec
tor); | 114 [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCSt
atsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selec
tor); |
116 | 115 |
117 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api | 116 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api |
118 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] | 117 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] |
119 // and be non-nullable. | 118 // and be non-nullable. |
120 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr
ing] DOMString? label, optional Dictionary options); | 119 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr
ing] DOMString? label, optional Dictionary options); |
121 attribute EventHandler ondatachannel; | 120 attribute EventHandler ondatachannel; |
122 | 121 |
123 // Non-standard or removed from the spec: | 122 // Non-standard or removed from the spec: |
124 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction
ary configuration, optional Dictionary mediaConstraints); | 123 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction
ary configuration, optional Dictionary mediaConstraints); |
125 sequence<MediaStream> getLocalStreams(); | 124 sequence<MediaStream> getLocalStreams(); |
126 sequence<MediaStream> getRemoteStreams(); | 125 sequence<MediaStream> getRemoteStreams(); |
127 MediaStream getStreamById(DOMString streamId); | 126 MediaStream getStreamById(DOMString streamId); |
128 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str
eam, optional Dictionary mediaConstraints); | 127 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str
eam, optional Dictionary mediaConstraints); |
129 [RaisesException] void removeStream(MediaStream? stream); | 128 [RaisesException] void removeStream(MediaStream? stream); |
130 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); | 129 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); |
131 attribute EventHandler onaddstream; | 130 attribute EventHandler onaddstream; |
132 attribute EventHandler onremovestream; | 131 attribute EventHandler onremovestream; |
133 | 132 |
134 // Certificate management | 133 // Certificate management |
135 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt | 134 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt |
136 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener
ateCertificate(AlgorithmIdentifier keygenAlgorithm); | 135 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener
ateCertificate(AlgorithmIdentifier keygenAlgorithm); |
137 }; | 136 }; |
OLD | NEW |