mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Start marking functions that can transitively trigger a GC (#33144)
* Mark JS reflector wrappers as CanGc. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from reflect_dom_object_with_proto. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Mark DOM constructors as GC operations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
9a1051c917
commit
60ef6bc461
140 changed files with 1336 additions and 304 deletions
|
@ -50,6 +50,7 @@ use crate::dom::rtcsessiondescription::RTCSessionDescription;
|
|||
use crate::dom::rtctrackevent::RTCTrackEvent;
|
||||
use crate::dom::window::Window;
|
||||
use crate::realms::{enter_realm, InRealm};
|
||||
use crate::script_runtime::CanGc;
|
||||
use crate::task::TaskCanceller;
|
||||
use crate::task_source::networking::NetworkingTaskSource;
|
||||
use crate::task_source::TaskSource;
|
||||
|
@ -197,11 +198,13 @@ impl RTCPeerConnection {
|
|||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
config: &RTCConfiguration,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<RTCPeerConnection> {
|
||||
let this = reflect_dom_object_with_proto(
|
||||
Box::new(RTCPeerConnection::new_inherited()),
|
||||
global,
|
||||
proto,
|
||||
can_gc,
|
||||
);
|
||||
let signaller = this.make_signaller();
|
||||
*this.controller.borrow_mut() = Some(ServoMedia::get().unwrap().create_webrtc(signaller));
|
||||
|
@ -232,9 +235,15 @@ impl RTCPeerConnection {
|
|||
pub fn Constructor(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
can_gc: CanGc,
|
||||
config: &RTCConfiguration,
|
||||
) -> Fallible<DomRoot<RTCPeerConnection>> {
|
||||
Ok(RTCPeerConnection::new(&window.global(), proto, config))
|
||||
Ok(RTCPeerConnection::new(
|
||||
&window.global(),
|
||||
proto,
|
||||
config,
|
||||
can_gc,
|
||||
))
|
||||
}
|
||||
|
||||
pub fn get_webrtc_controller(&self) -> &DomRefCell<Option<WebRtcController>> {
|
||||
|
@ -650,6 +659,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
let desc = RTCSessionDescription::Constructor(
|
||||
this.global().as_window(),
|
||||
None,
|
||||
CanGc::note(),
|
||||
&desc,
|
||||
).unwrap();
|
||||
this.local_description.set(Some(&desc));
|
||||
|
@ -690,6 +700,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
let desc = RTCSessionDescription::Constructor(
|
||||
this.global().as_window(),
|
||||
None,
|
||||
CanGc::note(),
|
||||
&desc,
|
||||
).unwrap();
|
||||
this.remote_description.set(Some(&desc));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue