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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 "completed", | 52 "completed", |
53 "failed", | 53 "failed", |
54 "disconnected", | 54 "disconnected", |
55 "closed" | 55 "closed" |
56 }; | 56 }; |
57 | 57 |
58 // https://w3c.github.io/webrtc-pc/#interface-definition | 58 // https://w3c.github.io/webrtc-pc/#interface-definition |
59 | 59 |
60 // TODO(guidou): Many types are of the wrong type in this interface: | 60 // TODO(guidou): Many types are of the wrong type in this interface: |
61 // * Dictionary -> specific dictionary types like RTCConfiguration | 61 // * Dictionary -> specific dictionary types like RTCConfiguration |
62 // * RTCErrorCallback -> RTCPeerConnectionErrorCallback | |
63 // * VoidCallback -> VoidFunction | 62 // * VoidCallback -> VoidFunction |
64 [ | 63 [ |
65 GarbageCollected, | 64 GarbageCollected, |
66 DependentLifetime, | 65 DependentLifetime, |
67 // TODO(guidou): There should only be one constructor argument, and it | 66 // TODO(guidou): There should only be one constructor argument, and it |
68 // should be optional. | 67 // should be optional. |
69 Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraint
s), | 68 Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraint
s), |
70 ConstructorCallWith=ExecutionContext, | 69 ConstructorCallWith=ExecutionContext, |
71 NoInterfaceObject, | 70 NoInterfaceObject, |
72 RaisesException=Constructor, | 71 RaisesException=Constructor, |
(...skipping 19 matching lines...) Expand all Loading... |
92 [RaisesException] void close(); | 91 [RaisesException] void close(); |
93 attribute EventHandler onnegotiationneeded; | 92 attribute EventHandler onnegotiationneeded; |
94 attribute EventHandler onicecandidate; | 93 attribute EventHandler onicecandidate; |
95 attribute EventHandler onsignalingstatechange; | 94 attribute EventHandler onsignalingstatechange; |
96 attribute EventHandler oniceconnectionstatechange; | 95 attribute EventHandler oniceconnectionstatechange; |
97 // attribute EventHandler onicegatheringstatechange; | 96 // attribute EventHandler onicegatheringstatechange; |
98 | 97 |
99 // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions | 98 // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions |
100 // These methods return or will be changed to return Promise<void> because | 99 // These methods return or will be changed to return Promise<void> because |
101 // having Promise-based versions requires that all overloads return Promises
. | 100 // having Promise-based versions requires that all overloads return Promises
. |
102 [CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDesc
riptionCallback successCallback, RTCErrorCallback failureCallback, optional Dict
ionary rtcOfferOptions); | 101 [CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDesc
riptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback,
optional Dictionary rtcOfferOptions); |
103 // TODO(guidou): There should be no mediaConstraints argument. | 102 // TODO(guidou): There should be no mediaConstraints argument. |
104 [CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDes
criptionCallback successCallback, RTCErrorCallback failureCallback, optional Dic
tionary mediaConstraints); | 103 [CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDes
criptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback
, optional Dictionary mediaConstraints); |
105 [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescripti
on description, VoidCallback successCallback, [Default=Undefined] optional RTCEr
rorCallback failureCallback); | 104 [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescripti
on description, VoidCallback successCallback, [Default=Undefined] optional RTCPe
erConnectionErrorCallback failureCallback); |
106 // TODO(guidou): The failureCallback argument should be non-optional. | 105 // TODO(guidou): The failureCallback argument should be non-optional. |
107 [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescript
ion description, VoidCallback successCallback, [Default=Undefined] optional RTCE
rrorCallback failureCallback); | 106 [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescript
ion description, VoidCallback successCallback, [Default=Undefined] optional RTCP
eerConnectionErrorCallback failureCallback); |
108 [CallWith=ScriptState] Promise<void> addIceCandidate(RTCIceCandidate candida
te, VoidCallback successCallback, RTCErrorCallback failureCallback); | 107 [CallWith=ScriptState] Promise<void> addIceCandidate(RTCIceCandidate candida
te, VoidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback
); |
109 // TODO(guidou): The selector argument should the first (nullable, | 108 // TODO(guidou): The selector argument should the first (nullable, |
110 // non-optional) argument, and there should be a third failureCallback | 109 // non-optional) argument, and there should be a third failureCallback |
111 // argument. | 110 // argument. |
112 [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCSt
atsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selec
tor); | 111 [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCSt
atsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selec
tor); |
113 | 112 |
114 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api | 113 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api |
115 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] | 114 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] |
116 // and be non-nullable. | 115 // and be non-nullable. |
117 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr
ing] DOMString? label, optional Dictionary options); | 116 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr
ing] DOMString? label, optional Dictionary options); |
118 attribute EventHandler ondatachannel; | 117 attribute EventHandler ondatachannel; |
119 | 118 |
120 // Non-standard or removed from the spec: | 119 // Non-standard or removed from the spec: |
121 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction
ary configuration, optional Dictionary mediaConstraints); | 120 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction
ary configuration, optional Dictionary mediaConstraints); |
122 sequence<MediaStream> getLocalStreams(); | 121 sequence<MediaStream> getLocalStreams(); |
123 sequence<MediaStream> getRemoteStreams(); | 122 sequence<MediaStream> getRemoteStreams(); |
124 MediaStream getStreamById(DOMString streamId); | 123 MediaStream getStreamById(DOMString streamId); |
125 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str
eam, optional Dictionary mediaConstraints); | 124 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str
eam, optional Dictionary mediaConstraints); |
126 [RaisesException] void removeStream(MediaStream? stream); | 125 [RaisesException] void removeStream(MediaStream? stream); |
127 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); | 126 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); |
128 attribute EventHandler onaddstream; | 127 attribute EventHandler onaddstream; |
129 attribute EventHandler onremovestream; | 128 attribute EventHandler onremovestream; |
130 | 129 |
131 // Certificate management | 130 // Certificate management |
132 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt | 131 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt |
133 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener
ateCertificate(AlgorithmIdentifier keygenAlgorithm); | 132 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener
ateCertificate(AlgorithmIdentifier keygenAlgorithm); |
134 }; | 133 }; |
OLD | NEW |