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

@ -21,7 +21,9 @@ use crate::dom::globalscope::GlobalScope;
use crate::dom::worker::TrustedWorkerAddress;
use crate::dom::workerglobalscope::WorkerGlobalScope;
use crate::fetch::load_whole_resource;
use crate::script_runtime::{new_rt_and_cx, CommonScriptMsg, Runtime, ScriptChan};
use crate::script_runtime::{
new_rt_and_cx, CommonScriptMsg, JSContext as SafeJSContext, Runtime, ScriptChan,
};
use crate::task_queue::{QueuedTask, QueuedTaskConversion, TaskQueue};
use crate::task_source::TaskSourceName;
use crossbeam_channel::{unbounded, Receiver, Sender};
@ -246,7 +248,7 @@ impl ServiceWorkerGlobalScope {
swmanager_sender,
scope_url,
));
unsafe { ServiceWorkerGlobalScopeBinding::Wrap(cx, scope) }
unsafe { ServiceWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
}
#[allow(unsafe_code)]