Skip to content

Commit

Permalink
Update interfaces/webrtc.idl (#19340)
Browse files Browse the repository at this point in the history
  • Loading branch information
autofoolip authored and foolip committed Sep 27, 2019
1 parent 4f7deba commit c3c56f5
Showing 1 changed file with 40 additions and 30 deletions.
70 changes: 40 additions & 30 deletions interfaces/webrtc.idl
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,20 @@ enum RTCIceConnectionState {
"connected"
};

[Exposed=Window, Constructor(optional RTCConfiguration configuration)]
interface RTCPeerConnection : EventTarget {
Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions options);
Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions options);
Promise<void> setLocalDescription(optional RTCSessionDescriptionInit description);
[Exposed=Window]
interface RTCPeerConnection : EventTarget {
constructor(optional RTCConfiguration configuration = {});
Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions options = {});
Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions options = {});
Promise<void> setLocalDescription(optional RTCSessionDescriptionInit description = {});
readonly attribute RTCSessionDescription? localDescription;
readonly attribute RTCSessionDescription? currentLocalDescription;
readonly attribute RTCSessionDescription? pendingLocalDescription;
Promise<void> setRemoteDescription(optional RTCSessionDescriptionInit description);
Promise<void> setRemoteDescription(optional RTCSessionDescriptionInit description = {});
readonly attribute RTCSessionDescription? remoteDescription;
readonly attribute RTCSessionDescription? currentRemoteDescription;
readonly attribute RTCSessionDescription? pendingRemoteDescription;
Promise<void> addIceCandidate(optional RTCIceCandidateInit candidate);
Promise<void> addIceCandidate(optional RTCIceCandidateInit candidate = {});
readonly attribute RTCSignalingState signalingState;
readonly attribute RTCIceGatheringState iceGatheringState;
readonly attribute RTCIceConnectionState iceConnectionState;
Expand All @@ -121,18 +122,21 @@ interface RTCPeerConnection : EventTarget {
attribute EventHandler oniceconnectionstatechange;
attribute EventHandler onicegatheringstatechange;
attribute EventHandler onconnectionstatechange;
};

partial interface RTCPeerConnection {
// Legacy Interface Extensions
// Supporting the methods in this section is optional.
// If these methods are supported
// they must be implemented as defined
// in section "Legacy Interface Extensions"
Promise<void> createOffer(RTCSessionDescriptionCallback successCallback,
RTCPeerConnectionErrorCallback failureCallback,
optional RTCOfferOptions options);
Promise<void> setLocalDescription(optional RTCSessionDescriptionInit description,
optional RTCOfferOptions options = {});
Promise<void> setLocalDescription(optional RTCSessionDescriptionInit description = {},
VoidFunction successCallback,
RTCPeerConnectionErrorCallback failureCallback);
Promise<void> createAnswer(RTCSessionDescriptionCallback successCallback,
RTCPeerConnectionErrorCallback failureCallback);
Promise<void> setRemoteDescription(optional RTCSessionDescriptionInit description,
Promise<void> setRemoteDescription(optional RTCSessionDescriptionInit description = {},
VoidFunction successCallback,
RTCPeerConnectionErrorCallback failureCallback);
Promise<void> addIceCandidate(RTCIceCandidateInit candidate,
Expand All @@ -156,8 +160,9 @@ enum RTCSdpType {
"rollback"
};

[Exposed=Window, Constructor(optional RTCSessionDescriptionInit descriptionInitDict)]
[Exposed=Window]
interface RTCSessionDescription {
constructor(optional RTCSessionDescriptionInit descriptionInitDict = {});
readonly attribute RTCSdpType type;
readonly attribute DOMString sdp;
[Default] object toJSON();
Expand All @@ -168,8 +173,9 @@ dictionary RTCSessionDescriptionInit {
DOMString sdp = "";
};

[Exposed=Window, Constructor(optional RTCIceCandidateInit candidateInitDict)]
[Exposed=Window]
interface RTCIceCandidate {
constructor(optional RTCIceCandidateInit candidateInitDict = {});
readonly attribute DOMString candidate;
readonly attribute DOMString? sdpMid;
readonly attribute unsigned short? sdpMLineIndex;
Expand Down Expand Up @@ -212,9 +218,9 @@ enum RTCIceCandidateType {
"relay"
};

[Exposed=Window,
Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict)]
[Exposed=Window]
interface RTCPeerConnectionIceEvent : Event {
constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict = {});
readonly attribute RTCIceCandidate? candidate;
readonly attribute DOMString? url;
};
Expand All @@ -224,9 +230,9 @@ dictionary RTCPeerConnectionIceEventInit : EventInit {
DOMString? url;
};

[Exposed=Window,
Constructor(DOMString type, RTCPeerConnectionIceErrorEventInit eventInitDict)]
[Exposed=Window]
interface RTCPeerConnectionIceErrorEvent : Event {
constructor(DOMString type, RTCPeerConnectionIceErrorEventInit eventInitDict);
readonly attribute DOMString hostCandidate;
readonly attribute DOMString url;
readonly attribute unsigned short errorCode;
Expand All @@ -248,7 +254,8 @@ enum RTCPriorityType {
};

partial interface RTCPeerConnection {
static Promise<RTCCertificate> generateCertificate(AlgorithmIdentifier keygenAlgorithm);
static Promise<RTCCertificate>
generateCertificate(AlgorithmIdentifier keygenAlgorithm);
};

dictionary RTCCertificateExpiration {
Expand All @@ -269,7 +276,7 @@ partial interface RTCPeerConnection {
RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
void removeTrack(RTCRtpSender sender);
RTCRtpTransceiver addTransceiver((MediaStreamTrack or DOMString) trackOrKind,
optional RTCRtpTransceiverInit init);
optional RTCRtpTransceiverInit init = {});
attribute EventHandler ontrack;
};

Expand Down Expand Up @@ -488,8 +495,9 @@ enum RTCIceComponent {
"rtcp"
};

[Exposed=Window, Constructor(DOMString type, RTCTrackEventInit eventInitDict)]
[Exposed=Window]
interface RTCTrackEvent : Event {
constructor(DOMString type, RTCTrackEventInit eventInitDict);
readonly attribute RTCRtpReceiver receiver;
readonly attribute MediaStreamTrack track;
[SameObject] readonly attribute FrozenArray<MediaStream> streams;
Expand All @@ -506,7 +514,7 @@ dictionary RTCTrackEventInit : EventInit {
partial interface RTCPeerConnection {
readonly attribute RTCSctpTransport? sctp;
RTCDataChannel createDataChannel(USVString label,
optional RTCDataChannelInit dataChannelDict);
optional RTCDataChannelInit dataChannelDict = {});
attribute EventHandler ondatachannel;
};

Expand Down Expand Up @@ -569,8 +577,9 @@ enum RTCDataChannelState {
"closed"
};

[Exposed=Window, Constructor(DOMString type, RTCDataChannelEventInit eventInitDict)]
[Exposed=Window]
interface RTCDataChannelEvent : Event {
constructor(DOMString type, RTCDataChannelEventInit eventInitDict);
readonly attribute RTCDataChannel channel;
};

Expand All @@ -590,9 +599,9 @@ interface RTCDTMFSender : EventTarget {
readonly attribute DOMString toneBuffer;
};

[Exposed=Window,
Constructor(DOMString type, RTCDTMFToneChangeEventInit eventInitDict)]
[Exposed=Window]
interface RTCDTMFToneChangeEvent : Event {
constructor(DOMString type, RTCDTMFToneChangeEventInit eventInitDict);
readonly attribute DOMString tone;
};

Expand All @@ -616,18 +625,19 @@ dictionary RTCStats {
required DOMString id;
};

[Exposed=Window,
Constructor(DOMString type, RTCStatsEventInit eventInitDict)]
[Exposed=Window]
interface RTCStatsEvent : Event {
constructor(DOMString type, RTCStatsEventInit eventInitDict);
readonly attribute RTCStatsReport report;
};

dictionary RTCStatsEventInit : EventInit {
required RTCStatsReport report;
};

[Exposed=Window, Constructor(RTCErrorInit init, optional DOMString message = "")]
[Exposed=Window]
interface RTCError : DOMException {
constructor(RTCErrorInit init, optional DOMString message = "");
readonly attribute RTCErrorDetailType errorDetail;
readonly attribute long? sdpLineNumber;
readonly attribute long? httpRequestStatusCode;
Expand Down Expand Up @@ -663,9 +673,9 @@ enum RTCErrorDetailType {
"hardware-encoder-error"
};

[Exposed=Window,
Constructor(DOMString type, RTCErrorEventInit eventInitDict)]
[Exposed=Window]
interface RTCErrorEvent : Event {
constructor(DOMString type, RTCErrorEventInit eventInitDict);
[SameObject] readonly attribute RTCError error;
};

Expand Down

0 comments on commit c3c56f5

Please sign in to comment.