Various CanGc fixes (#33800)

* CanGc fix for pagetransitionevent

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for dom/node

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for gamepad

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for gpu

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for dom/element

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for xhr

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for dom/worker

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for rtcdatachannel

Signed-off-by: webbeef <me@webbeef.org>

* CanGc fix for rtcerror

Signed-off-by: webbeef <me@webbeef.org>

* Address review comments

Signed-off-by: webbeef <me@webbeef.org>

---------

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2024-10-10 20:53:39 -07:00 committed by GitHub
parent c00c6e728d
commit 2b71130a8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 168 additions and 119 deletions

View file

@ -31,16 +31,19 @@ impl GPUCompilationInfo {
}
#[allow(dead_code)]
pub fn new(global: &GlobalScope, msg: Vec<DomRoot<GPUCompilationMessage>>) -> DomRoot<Self> {
reflect_dom_object_with_proto(
Box::new(Self::new_inherited(msg)),
global,
None,
CanGc::note(),
)
pub fn new(
global: &GlobalScope,
msg: Vec<DomRoot<GPUCompilationMessage>>,
can_gc: CanGc,
) -> DomRoot<Self> {
reflect_dom_object_with_proto(Box::new(Self::new_inherited(msg)), global, None, can_gc)
}
pub fn from(global: &GlobalScope, error: Option<ShaderCompilationInfo>) -> DomRoot<Self> {
pub fn from(
global: &GlobalScope,
error: Option<ShaderCompilationInfo>,
can_gc: CanGc,
) -> DomRoot<Self> {
Self::new(
global,
if let Some(error) = error {
@ -48,6 +51,7 @@ impl GPUCompilationInfo {
} else {
Vec::new()
},
can_gc,
)
}
}