mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add RTCPeerConnection::Close
This commit is contained in:
parent
5cb5503a75
commit
7343241c3d
2 changed files with 26 additions and 1 deletions
|
@ -586,6 +586,31 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
fn SignalingState(&self) -> RTCSignalingState {
|
||||
self.signaling_state.get()
|
||||
}
|
||||
|
||||
/// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close
|
||||
fn Close(&self) {
|
||||
// Step 1
|
||||
if self.closed.get() {
|
||||
return;
|
||||
}
|
||||
// Step 2
|
||||
self.closed.set(true);
|
||||
|
||||
// Step 4
|
||||
self.signaling_state.set(RTCSignalingState::Closed);
|
||||
|
||||
// Step 5 handled by backend
|
||||
self.controller.borrow_mut().as_ref().unwrap().quit();
|
||||
|
||||
// Step 6-10
|
||||
// (no current support for data channels, transports, etc)
|
||||
|
||||
// Step 11
|
||||
self.ice_connection_state.set(RTCIceConnectionState::Closed);
|
||||
|
||||
// Step 11
|
||||
// (no current support for connection state)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<SessionDescription> for RTCSessionDescriptionInit {
|
||||
|
|
|
@ -26,7 +26,7 @@ interface RTCPeerConnection : EventTarget {
|
|||
// static sequence<RTCIceServer> getDefaultIceServers();
|
||||
// RTCConfiguration getConfiguration();
|
||||
// void setConfiguration(RTCConfiguration configuration);
|
||||
// void close();
|
||||
void close();
|
||||
attribute EventHandler onnegotiationneeded;
|
||||
attribute EventHandler onicecandidate;
|
||||
// attribute EventHandler onicecandidateerror;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue