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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions | 98 // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions |
99 // These methods return Promise<void> because having Promise-based versions
requires that all overloads return Promises. | 99 // These methods return Promise<void> because having Promise-based versions
requires that all overloads return Promises. |
100 [CallWith=ScriptState] Promise<void> createOffer(RTCSessionDescriptionCallba
ck successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Dic
tionary rtcOfferOptions); | 100 [CallWith=ScriptState] Promise<void> createOffer(RTCSessionDescriptionCallba
ck successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Dic
tionary rtcOfferOptions); |
101 // TODO(guidou): There should be no mediaConstraints argument. | 101 // TODO(guidou): There should be no mediaConstraints argument. |
102 [CallWith=ScriptState] Promise<void> createAnswer(RTCSessionDescriptionCallb
ack successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Di
ctionary mediaConstraints); | 102 [CallWith=ScriptState] Promise<void> createAnswer(RTCSessionDescriptionCallb
ack successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Di
ctionary mediaConstraints); |
103 [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescripti
onInit description, VoidCallback successCallback, [Default=Undefined] optional R
TCPeerConnectionErrorCallback failureCallback); | 103 [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescripti
onInit description, VoidCallback successCallback, [Default=Undefined] optional R
TCPeerConnectionErrorCallback failureCallback); |
104 // TODO(guidou): The failureCallback argument should be non-optional. | 104 // TODO(guidou): The failureCallback argument should be non-optional. |
105 [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescript
ionInit description, VoidCallback successCallback, [Default=Undefined] optional
RTCPeerConnectionErrorCallback failureCallback); | 105 [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescript
ionInit description, VoidCallback successCallback, [Default=Undefined] optional
RTCPeerConnectionErrorCallback failureCallback); |
106 [CallWith=ScriptState, MeasureAs=RTCPeerConnectionAddIceCandidateLegacy] Pro
mise<void> addIceCandidate((RTCIceCandidateInit or RTCIceCandidate) candidate, V
oidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback); | 106 [CallWith=ScriptState, MeasureAs=RTCPeerConnectionAddIceCandidateLegacy] Pro
mise<void> addIceCandidate((RTCIceCandidateInit or RTCIceCandidate) candidate, V
oidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback); |
| 107 |
107 // TODO(guidou): The selector argument should the first (nullable, | 108 // TODO(guidou): The selector argument should the first (nullable, |
108 // non-optional) argument, and there should be a third failureCallback | 109 // non-optional) argument, and there should be a third failureCallback |
109 // argument. | 110 // argument. |
110 [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCSt
atsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selec
tor); | 111 // TODO(hbos): This is the desired getStats IDL: |
| 112 // [CallWith=ScriptState] Promise<void> getStats(RTCStatsCallback successCa
llback, optional MediaStreamTrack? selector); |
| 113 // [CallWith=ScriptState] Promise<RTCStatsReport> getStats(optional MediaSt
reamTrack? selector); |
| 114 // But the generated V8 bindings code is unable to distinguish between the |
| 115 // two cases (e.g. single argument case always calls the MediaStreamTrack |
| 116 // version). As a workaround, in order to support both signatures |
| 117 // |getStats(optional any)| is used. In RTCPeerConnection.cpp we dispatch to |
| 118 // the correct |getStats| function based on value type. crbug.com/629068. |
| 119 [CallWith=ScriptState] Promise getStats(optional any value); |
| 120 [CallWith=ScriptState] Promise<void> getStats(RTCStatsCallback successCallba
ck, MediaStreamTrack? selector); |
111 | 121 |
112 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api | 122 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api |
113 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] | 123 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] |
114 // and be non-nullable. | 124 // and be non-nullable. |
115 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr
ing] DOMString? label, optional Dictionary options); | 125 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr
ing] DOMString? label, optional Dictionary options); |
116 attribute EventHandler ondatachannel; | 126 attribute EventHandler ondatachannel; |
117 | 127 |
118 // Non-standard or removed from the spec: | 128 // Non-standard or removed from the spec: |
119 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction
ary configuration, optional Dictionary mediaConstraints); | 129 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction
ary configuration, optional Dictionary mediaConstraints); |
120 sequence<MediaStream> getLocalStreams(); | 130 sequence<MediaStream> getLocalStreams(); |
121 sequence<MediaStream> getRemoteStreams(); | 131 sequence<MediaStream> getRemoteStreams(); |
122 MediaStream getStreamById(DOMString streamId); | 132 MediaStream getStreamById(DOMString streamId); |
123 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str
eam, optional Dictionary mediaConstraints); | 133 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str
eam, optional Dictionary mediaConstraints); |
124 [RaisesException] void removeStream(MediaStream? stream); | 134 [RaisesException] void removeStream(MediaStream? stream); |
125 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); | 135 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); |
126 attribute EventHandler onaddstream; | 136 attribute EventHandler onaddstream; |
127 attribute EventHandler onremovestream; | 137 attribute EventHandler onremovestream; |
128 | 138 |
129 // Certificate management | 139 // Certificate management |
130 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt | 140 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt |
131 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener
ateCertificate(AlgorithmIdentifier keygenAlgorithm); | 141 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener
ateCertificate(AlgorithmIdentifier keygenAlgorithm); |
132 }; | 142 }; |
OLD | NEW |