mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Fix rooting issue
This commit is contained in:
parent
7eb44f81f2
commit
6ebb73d9a4
2 changed files with 10 additions and 5 deletions
|
@ -85,8 +85,6 @@ impl RTCDataChannel {
|
||||||
binary_type: DomRefCell::new(DOMString::from("blob")),
|
binary_type: DomRefCell::new(DOMString::from("blob")),
|
||||||
};
|
};
|
||||||
|
|
||||||
peer_connection.register_data_channel(servo_media_id, &channel);
|
|
||||||
|
|
||||||
channel
|
channel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,6 +105,8 @@ impl RTCDataChannel {
|
||||||
global,
|
global,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
peer_connection.register_data_channel(rtc_data_channel.servo_media_id, &*rtc_data_channel);
|
||||||
|
|
||||||
rtc_data_channel
|
rtc_data_channel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ use crate::dom::rtcpeerconnectioniceevent::RTCPeerConnectionIceEvent;
|
||||||
use crate::dom::rtcsessiondescription::RTCSessionDescription;
|
use crate::dom::rtcsessiondescription::RTCSessionDescription;
|
||||||
use crate::dom::rtctrackevent::RTCTrackEvent;
|
use crate::dom::rtctrackevent::RTCTrackEvent;
|
||||||
use crate::dom::window::Window;
|
use crate::dom::window::Window;
|
||||||
use crate::realms::InRealm;
|
use crate::realms::{enter_realm, InRealm};
|
||||||
use crate::task::TaskCanceller;
|
use crate::task::TaskCanceller;
|
||||||
use crate::task_source::networking::NetworkingTaskSource;
|
use crate::task_source::networking::NetworkingTaskSource;
|
||||||
use crate::task_source::TaskSource;
|
use crate::task_source::TaskSource;
|
||||||
|
@ -161,6 +161,8 @@ impl WebRtcSignaller for RTCSignaller {
|
||||||
let _ = self.task_source.queue_with_canceller(
|
let _ = self.task_source.queue_with_canceller(
|
||||||
task!(on_data_channel_event: move || {
|
task!(on_data_channel_event: move || {
|
||||||
let this = this.root();
|
let this = this.root();
|
||||||
|
let global = this.global();
|
||||||
|
let _ac = enter_realm(&*global);
|
||||||
this.on_data_channel_event(channel, event);
|
this.on_data_channel_event(channel, event);
|
||||||
}),
|
}),
|
||||||
&self.canceller,
|
&self.canceller,
|
||||||
|
@ -314,7 +316,10 @@ impl RTCPeerConnection {
|
||||||
let channel = if let Some(channel) = self.data_channels.borrow().get(&channel_id) {
|
let channel = if let Some(channel) = self.data_channels.borrow().get(&channel_id) {
|
||||||
DomRoot::from_ref(&**channel)
|
DomRoot::from_ref(&**channel)
|
||||||
} else {
|
} else {
|
||||||
debug_assert!(false, "Got an event for an unregistered data channel");
|
warn!(
|
||||||
|
"Got an event for an unregistered data channel {:?}",
|
||||||
|
channel_id
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -337,7 +342,7 @@ impl RTCPeerConnection {
|
||||||
.insert(id, Dom::from_ref(channel))
|
.insert(id, Dom::from_ref(channel))
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
debug_assert!(false, "Data channel already registered");
|
warn!("Data channel already registered {:?}", id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue