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 | |
philipj_slow
2016/02/15 10:22:21
Oh, here's the answer to haraken@'s question too.
| |
101 // having Promise-based versions requires that all overloads return Promises . | |
101 [CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDesc riptionCallback successCallback, RTCErrorCallback failureCallback, optional Dict ionary rtcOfferOptions); | 102 [CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDesc riptionCallback successCallback, RTCErrorCallback failureCallback, optional Dict ionary rtcOfferOptions); |
102 // TODO(guidou): There should be no mediaConstraints argument. | 103 // TODO(guidou): There should be no mediaConstraints argument. |
103 [CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDes criptionCallback successCallback, RTCErrorCallback failureCallback, optional Dic tionary mediaConstraints); | 104 [CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDes criptionCallback successCallback, RTCErrorCallback failureCallback, optional Dic tionary mediaConstraints); |
104 // TODO(guidou): None of the arguments should be optional. | 105 [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescripti on description, VoidCallback successCallback, [Default=Undefined] optional RTCEr rorCallback failureCallback); |
105 [CallWith=ExecutionContext, RaisesException] void setLocalDescription(RTCSes sionDescription description, [Default=Undefined] optional VoidCallback successCa llback, [Default=Undefined] optional RTCErrorCallback failureCallback); | 106 // TODO(guidou): The failureCallback argument should be non-optional. |
106 // TODO(guidou): The successCallback and failureCallback arguments should be | 107 [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescript ion description, VoidCallback successCallback, [Default=Undefined] optional RTCE rrorCallback failureCallback); |
107 // non-optional. | 108 [CallWith=ScriptState] Promise<void> addIceCandidate(RTCIceCandidate candida te, VoidCallback successCallback, RTCErrorCallback failureCallback); |
108 [CallWith=ExecutionContext, RaisesException] void setRemoteDescription(RTCSe ssionDescription description, [Default=Undefined] optional VoidCallback successC allback, [Default=Undefined] optional RTCErrorCallback failureCallback); | |
109 [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallba ck successCallback, RTCErrorCallback failureCallback); | |
110 // TODO(guidou): The selector argument should the first (nullable, | 109 // TODO(guidou): The selector argument should the first (nullable, |
111 // non-optional) argument, and there should be a third failureCallback | 110 // non-optional) argument, and there should be a third failureCallback |
112 // argument. | 111 // argument. |
113 [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCSt atsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selec tor); | 112 [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCSt atsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selec tor); |
114 | 113 |
115 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api | 114 // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api |
116 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] | 115 // TODO(guidou): The label argument should have [TreatNullAs=EmptyString] |
117 // and be non-nullable. | 116 // and be non-nullable. |
118 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr ing] DOMString? label, optional Dictionary options); | 117 [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullStr ing] DOMString? label, optional Dictionary options); |
119 attribute EventHandler ondatachannel; | 118 attribute EventHandler ondatachannel; |
120 | 119 |
121 // Non-standard or removed from the spec: | 120 // Non-standard or removed from the spec: |
122 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction ary configuration, optional Dictionary mediaConstraints); | 121 [CallWith=ExecutionContext, RaisesException] void updateIce(optional Diction ary configuration, optional Dictionary mediaConstraints); |
123 sequence<MediaStream> getLocalStreams(); | 122 sequence<MediaStream> getLocalStreams(); |
124 sequence<MediaStream> getRemoteStreams(); | 123 sequence<MediaStream> getRemoteStreams(); |
125 MediaStream getStreamById(DOMString streamId); | 124 MediaStream getStreamById(DOMString streamId); |
126 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str eam, optional Dictionary mediaConstraints); | 125 [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? str eam, optional Dictionary mediaConstraints); |
127 [RaisesException] void removeStream(MediaStream? stream); | 126 [RaisesException] void removeStream(MediaStream? stream); |
128 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); | 127 [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track); |
129 attribute EventHandler onaddstream; | 128 attribute EventHandler onaddstream; |
130 attribute EventHandler onremovestream; | 129 attribute EventHandler onremovestream; |
131 | 130 |
132 // Certificate management | 131 // Certificate management |
133 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt | 132 // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt |
134 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener ateCertificate(AlgorithmIdentifier keygenAlgorithm); | 133 [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> gener ateCertificate(AlgorithmIdentifier keygenAlgorithm); |
135 }; | 134 }; |
OLD | NEW |