mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Various CanGc fixes in components/script/dom (#33706)
* Propagate 'can_gc' in IFrame DOM code Signed-off-by: webbeef <me@webbeef.org> * Propagate 'can_gc' in HTML video and image elements Signed-off-by: webbeef <me@webbeef.org> * Propagate 'can_gc' in Blob and dependencies Signed-off-by: webbeef <me@webbeef.org> * Leftover can_gc fixes for HTMLMediaElement Signed-off-by: webbeef <me@webbeef.org> * Address comment Signed-off-by: webbeef <me@webbeef.org> --------- Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
7d931e673a
commit
d3c0785d64
14 changed files with 67 additions and 42 deletions
|
@ -12,10 +12,10 @@ use crate::dom::bindings::root::DomRoot;
|
|||
use crate::dom::bindings::trace::JSTraceable;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::realms::InRealm;
|
||||
use crate::script_runtime::JSContext as SafeJSContext;
|
||||
use crate::script_runtime::{CanGc, JSContext as SafeJSContext};
|
||||
|
||||
pub trait Callback: JSTraceable + MallocSizeOf {
|
||||
fn callback(&self, cx: SafeJSContext, v: HandleValue, realm: InRealm);
|
||||
fn callback(&self, cx: SafeJSContext, v: HandleValue, realm: InRealm, can_gc: CanGc);
|
||||
}
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -50,7 +50,7 @@ impl PromiseNativeHandler {
|
|||
) {
|
||||
let cx = unsafe { SafeJSContext::from_ptr(cx) };
|
||||
if let Some(ref callback) = *callback {
|
||||
callback.callback(cx, v, realm)
|
||||
callback.callback(cx, v, realm, CanGc::note())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue