mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Fixes (partially) #26488 and apply the https://github.com/servo/servo/pull/37324#discussion_r2133989190 comment. Testing: No tests added Fixes: Partially #26488 --------- Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
This commit is contained in:
parent
f451dccd0b
commit
b8738074d1
4 changed files with 62 additions and 25 deletions
|
@ -8,6 +8,7 @@ use std::rc::Rc;
|
|||
|
||||
use dom_struct::dom_struct;
|
||||
use js::rust::HandleObject;
|
||||
use script_bindings::weakref::WeakReferenceable;
|
||||
use servo_media::ServoMedia;
|
||||
use servo_media::streams::MediaStreamType;
|
||||
use servo_media::streams::registry::MediaStreamId;
|
||||
|
@ -309,15 +310,16 @@ impl RTCPeerConnection {
|
|||
event.upcast::<Event>().fire(self.upcast(), can_gc);
|
||||
},
|
||||
_ => {
|
||||
let channel = if let Some(channel) = self.data_channels.borrow().get(&channel_id) {
|
||||
DomRoot::from_ref(&**channel)
|
||||
} else {
|
||||
warn!(
|
||||
"Got an event for an unregistered data channel {:?}",
|
||||
channel_id
|
||||
);
|
||||
return;
|
||||
};
|
||||
let channel: DomRoot<RTCDataChannel> =
|
||||
if let Some(channel) = self.data_channels.borrow().get(&channel_id) {
|
||||
DomRoot::from_ref(&**channel)
|
||||
} else {
|
||||
warn!(
|
||||
"Got an event for an unregistered data channel {:?}",
|
||||
channel_id
|
||||
);
|
||||
return;
|
||||
};
|
||||
|
||||
match event {
|
||||
DataChannelEvent::Open => channel.on_open(can_gc),
|
||||
|
@ -789,6 +791,8 @@ impl RTCPeerConnectionMethods<crate::DomTypeHolder> for RTCPeerConnection {
|
|||
}
|
||||
}
|
||||
|
||||
impl WeakReferenceable for RTCPeerConnection {}
|
||||
|
||||
impl Convert<RTCSessionDescriptionInit> for SessionDescription {
|
||||
fn convert(self) -> RTCSessionDescriptionInit {
|
||||
let type_ = match self.type_ {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue