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
|
@ -23,7 +23,7 @@ use crate::dom::eventtarget::EventTarget;
|
|||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use crate::dom::offscreencanvasrenderingcontext2d::OffscreenCanvasRenderingContext2D;
|
||||
use crate::script_runtime::JSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
||||
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(Clone, JSTraceable, MallocSizeOf)]
|
||||
|
@ -63,11 +63,13 @@ impl OffscreenCanvas {
|
|||
width: u64,
|
||||
height: u64,
|
||||
placeholder: Option<&HTMLCanvasElement>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<OffscreenCanvas> {
|
||||
reflect_dom_object_with_proto(
|
||||
Box::new(OffscreenCanvas::new_inherited(width, height, placeholder)),
|
||||
global,
|
||||
proto,
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -75,10 +77,11 @@ impl OffscreenCanvas {
|
|||
pub fn Constructor(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
can_gc: CanGc,
|
||||
width: u64,
|
||||
height: u64,
|
||||
) -> Fallible<DomRoot<OffscreenCanvas>> {
|
||||
let offscreencanvas = OffscreenCanvas::new(global, proto, width, height, None);
|
||||
let offscreencanvas = OffscreenCanvas::new(global, proto, width, height, None, can_gc);
|
||||
Ok(offscreencanvas)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue