Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 // https://w3c.github.io/webrtc-pc/#state-definitions | |
| 32 | |
| 33 enum RTCSignalingState { | |
| 34 "stable", | |
| 35 "have-local-offer", | |
| 36 "have-remote-offer", | |
| 37 "have-local-pranswer", | |
| 38 "have-remote-pranswer", | |
| 39 "closed" | |
| 40 }; | |
| 41 | |
| 42 enum RTCIceGatheringState { | |
| 43 "new", | |
| 44 "gathering", | |
| 45 "complete" | |
| 46 }; | |
| 47 | |
| 48 enum RTCIceConnectionState { | |
| 49 "new", | |
| 50 "checking", | |
| 51 "connected", | |
| 52 "completed", | |
| 53 "failed", | |
| 54 "disconnected", | |
| 55 "closed" | |
| 56 }; | |
| 57 | |
| 58 // https://w3c.github.io/webrtc-pc/#interface-definition | |
| 59 | |
| 60 // TODO(guido): Many types are of the wrong type in this interface: | |
|
Guido Urdaneta
2015/09/29 11:43:49
my username is guidou :)
philipj_slow
2015/09/29 12:04:13
Oops, fixed :)
| |
| 61 // * Dictionary -> specific dictionary types like RTCConfiguration | |
| 62 // * RTCErrorCallback -> RTCPeerConnectionErrorCallback | |
| 63 // * VoidCallback -> VoidFunction | |
| 31 [ | 64 [ |
| 32 GarbageCollected, | 65 GarbageCollected, |
| 33 ActiveDOMObject, | 66 ActiveDOMObject, |
| 67 // TODO(guido): There should only be one constructor argument, and it should | |
| 68 // be optional. | |
| 34 Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraint s), | 69 Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraint s), |
| 35 ConstructorCallWith=ExecutionContext, | 70 ConstructorCallWith=ExecutionContext, |
| 36 NoInterfaceObject, | 71 NoInterfaceObject, |
| 37 RaisesException=Constructor, | 72 RaisesException=Constructor, |
| 38 ] interface RTCPeerConnection : EventTarget { | 73 ] interface RTCPeerConnection : EventTarget { |
| 74 // Promise<RTCSessionDescription> createOffer(optional RTCOfferOptions optio ns); | |
| 75 // Promise<RTCSessionDescription> createAnswer(optional RTCAnswerOptions opt ions); | |
| 76 // Promise<void> setLocalDescription(RTCSessionDescription description); | |
| 77 readonly attribute RTCSessionDescription? localDescription; | |
| 78 // readonly attribute RTCSessionDescription? currentLocalDescription; | |
| 79 // readonly attribute RTCSessionDescription? pendingLocalDescription; | |
| 80 // Promise<void> setRemoteDescription(RTCSessionDescription description); | |
| 81 readonly attribute RTCSessionDescription? remoteDescription; | |
| 82 // readonly attribute RTCSessionDescription? currentRemoteDescription; | |
| 83 // readonly attribute RTCSessionDescription? pendingRemoteDescription; | |
| 84 // TODO(guido): addIceCandidate() should return a Promise. | |
| 85 [RaisesException] void addIceCandidate(RTCIceCandidate candidate); | |
| 86 readonly attribute RTCSignalingState signalingState; | |
| 87 readonly attribute RTCIceGatheringState iceGatheringState; | |
| 88 readonly attribute RTCIceConnectionState iceConnectionState; | |
| 89 // readonly attribute boolean? canTrickleIceCandidates; | |
| 90 // RTCConfiguration getConfiguration(); | |
| 91 // void setConfiguration(RTCConfiguration configuration); | |
| 92 // TODO(guido): close() should never throw an exception. | |
| 93 [RaisesException] void close(); | |
| 94 attribute EventHandler onnegotiationneeded; | |
| 95 attribute EventHandler onicecandidate; | |
| 96 attribute EventHandler onsignalingstatechange; | |
| 97 attribute EventHandler oniceconnectionstatechange; | |
| 98 // attribute EventHandler onicegatheringstatechange; | |
| 99 | |
| 100 // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions | |
| 101 // TODO(guido): The failureCallback argument should be non-optional. | |
| 39 [RaisesException] void createOffer(RTCSessionDescriptionCallback successCall back, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Di ctionary rtcOfferOptions); | 102 [RaisesException] void createOffer(RTCSessionDescriptionCallback successCall back, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Di ctionary rtcOfferOptions); |
| 103 // TODO(guido): None of the arguments should be optional. | |
| 104 [RaisesException] void setLocalDescription(RTCSessionDescription description , [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback); | |
| 105 // TODO(guido): The failureCallback argument should be non-optional, and | |
| 106 // there should be no mediaConstraints argument. | |
| 107 [RaisesException] void createAnswer(RTCSessionDescriptionCallback successCal lback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional D ictionary mediaConstraints); | |
| 108 // TODO(guido): The successCallback and failureCallback arguments should be | |
| 109 // non-optional. | |
| 110 [RaisesException] void setRemoteDescription(RTCSessionDescription descriptio n, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined ] optional RTCErrorCallback failureCallback); | |
| 111 [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallba ck successCallback, RTCErrorCallback failureCallback); | |
| 112 // TODO(guido): The selector argument should the first (nullable, | |
| 113 // non-optional) argument, and there should be a third failureCallback | |
| 114 // argument. | |
| 115 void getStats(RTCStatsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selector); | |
| 40 | 116 |
| 41 [RaisesException] void createAnswer(RTCSessionDescriptionCallback successCal lback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional D ictionary mediaConstraints); | 117 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api |
| 118 // TODO(guido): The label argument should have [TreatNullAs=EmptyString] and | |
| 119 // be non-nullable. | |
| 120 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr ing] DOMString? label, optional Dictionary options); | |
| 121 attribute EventHandler ondatachannel; | |
| 42 | 122 |
| 43 [RaisesException] void setLocalDescription(RTCSessionDescription description , [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback); | 123 // Non-standard or removed from the spec: |
| 44 [RaisesException=Getter] readonly attribute RTCSessionDescription localDescr iption; | |
| 45 | |
| 46 [RaisesException] void setRemoteDescription(RTCSessionDescription descriptio n, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined ] optional RTCErrorCallback failureCallback); | |
| 47 [RaisesException=Getter] readonly attribute RTCSessionDescription remoteDesc ription; | |
| 48 | |
| 49 readonly attribute DOMString signalingState; | |
| 50 | |
| 51 [RaisesException] void updateIce(optional Dictionary configuration, optional Dictionary mediaConstraints); | 124 [RaisesException] void updateIce(optional Dictionary configuration, optional Dictionary mediaConstraints); |
| 52 | |
| 53 // DEPRECATED | |
| 54 [RaisesException] void addIceCandidate(RTCIceCandidate candidate); | |
| 55 | |
| 56 [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallba ck successCallback, RTCErrorCallback failureCallback); | |
| 57 | |
| 58 readonly attribute DOMString iceGatheringState; | |
| 59 readonly attribute DOMString iceConnectionState; | |
| 60 | |
| 61 sequence<MediaStream> getLocalStreams(); | 125 sequence<MediaStream> getLocalStreams(); |
| 62 sequence<MediaStream> getRemoteStreams(); | 126 sequence<MediaStream> getRemoteStreams(); |
| 63 MediaStream getStreamById(DOMString streamId); | 127 MediaStream getStreamById(DOMString streamId); |
| 64 | |
| 65 [TypeChecking=Interface, RaisesException] void addStream(MediaStream? stream , optional Dictionary mediaConstraints); | 128 [TypeChecking=Interface, RaisesException] void addStream(MediaStream? stream , optional Dictionary mediaConstraints); |
| 66 [TypeChecking=Interface, RaisesException] void removeStream(MediaStream? str eam); | 129 [TypeChecking=Interface, RaisesException] void removeStream(MediaStream? str eam); |
| 67 | |
| 68 void getStats(RTCStatsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selector); | |
| 69 | |
| 70 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr ing] DOMString? label, optional Dictionary options); | |
| 71 | |
| 72 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); | 130 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); |
| 73 | |
| 74 [RaisesException] void close(); | |
| 75 | |
| 76 attribute EventHandler onnegotiationneeded; | |
| 77 attribute EventHandler onicecandidate; | |
| 78 attribute EventHandler onsignalingstatechange; | |
| 79 attribute EventHandler onaddstream; | 131 attribute EventHandler onaddstream; |
| 80 attribute EventHandler onremovestream; | 132 attribute EventHandler onremovestream; |
| 81 attribute EventHandler oniceconnectionstatechange; | |
| 82 attribute EventHandler ondatachannel; | |
| 83 }; | 133 }; |
| OLD | NEW |