mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -71,7 +71,7 @@ use crate::dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
|
|||
use crate::dom::xmlhttprequestupload::XMLHttpRequestUpload;
|
||||
use crate::fetch::FetchCanceller;
|
||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||
use crate::script_runtime::JSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
||||
use crate::task_source::networking::NetworkingTaskSource;
|
||||
use crate::task_source::TaskSourceName;
|
||||
use crate::timers::{OneshotTimerCallback, OneshotTimerHandle};
|
||||
|
@ -219,11 +219,16 @@ impl XMLHttpRequest {
|
|||
}
|
||||
}
|
||||
|
||||
fn new(global: &GlobalScope, proto: Option<HandleObject>) -> DomRoot<XMLHttpRequest> {
|
||||
fn new(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<XMLHttpRequest> {
|
||||
reflect_dom_object_with_proto(
|
||||
Box::new(XMLHttpRequest::new_inherited(global)),
|
||||
global,
|
||||
proto,
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -232,8 +237,9 @@ impl XMLHttpRequest {
|
|||
pub fn Constructor(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
can_gc: CanGc,
|
||||
) -> Fallible<DomRoot<XMLHttpRequest>> {
|
||||
Ok(XMLHttpRequest::new(global, proto))
|
||||
Ok(XMLHttpRequest::new(global, proto, can_gc))
|
||||
}
|
||||
|
||||
fn sync_in_window(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue