mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -38,8 +38,8 @@ use crate::dom::event::{Event, EventBubbles, EventCancelable};
|
|||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::messageevent::MessageEvent;
|
||||
use crate::script_runtime::CommonScriptMsg;
|
||||
use crate::script_runtime::ScriptThreadEventCategory::WebSocketEvent;
|
||||
use crate::script_runtime::{CanGc, CommonScriptMsg};
|
||||
use crate::task::{TaskCanceller, TaskOnce};
|
||||
use crate::task_source::websocket::WebsocketTaskSource;
|
||||
use crate::task_source::TaskSource;
|
||||
|
@ -134,11 +134,13 @@ impl WebSocket {
|
|||
proto: Option<HandleObject>,
|
||||
url: ServoUrl,
|
||||
sender: IpcSender<WebSocketDomAction>,
|
||||
can_gc: CanGc,
|
||||
) -> DomRoot<WebSocket> {
|
||||
reflect_dom_object_with_proto(
|
||||
Box::new(WebSocket::new_inherited(url, sender)),
|
||||
global,
|
||||
proto,
|
||||
can_gc,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -147,6 +149,7 @@ impl WebSocket {
|
|||
pub fn Constructor(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
can_gc: CanGc,
|
||||
url: DOMString,
|
||||
protocols: Option<StringOrStringSequence>,
|
||||
) -> Fallible<DomRoot<WebSocket>> {
|
||||
|
@ -200,7 +203,7 @@ impl WebSocket {
|
|||
ProfiledIpc::IpcReceiver<WebSocketNetworkEvent>,
|
||||
) = ProfiledIpc::channel(global.time_profiler_chan().clone()).unwrap();
|
||||
|
||||
let ws = WebSocket::new(global, proto, url_record.clone(), dom_action_sender);
|
||||
let ws = WebSocket::new(global, proto, url_record.clone(), dom_action_sender, can_gc);
|
||||
let address = Trusted::new(&*ws);
|
||||
|
||||
// Step 8.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue