Wrap(Global)Method now takes a SafeJSContext instead of a JSContext

as first argument.
This commit is contained in:
marmeladema 2019-07-20 17:30:10 +01:00
parent cd0eb88a3e
commit 35dc5320ab
10 changed files with 55 additions and 37 deletions

View file

@ -23,6 +23,7 @@ use crate::dom::worklet::WorkletExecutor;
use crate::dom::workletglobalscope::WorkletGlobalScope;
use crate::dom::workletglobalscope::WorkletGlobalScopeInit;
use crate::dom::workletglobalscope::WorkletTask;
use crate::script_runtime::JSContext;
use crossbeam_channel::{unbounded, Sender};
use dom_struct::dom_struct;
use euclid::Scale;
@ -128,7 +129,7 @@ impl PaintWorkletGlobalScope {
missing_image_urls: Vec::new(),
}),
});
unsafe { PaintWorkletGlobalScopeBinding::Wrap(runtime.cx(), global) }
unsafe { PaintWorkletGlobalScopeBinding::Wrap(JSContext::from_ptr(runtime.cx()), global) }
}
pub fn image_cache(&self) -> Arc<dyn ImageCache> {