mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Convert CGTraitInterface to use safe JSContext instead of raw JSContext
This commit is contained in:
parent
808fa65aef
commit
2c5d0a6ebc
43 changed files with 443 additions and 528 deletions
|
@ -560,10 +560,9 @@ unsafe extern "C" fn interrupt_callback(cx: *mut JSContext) -> bool {
|
|||
}
|
||||
|
||||
impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope {
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-postmessage
|
||||
unsafe fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
|
||||
let data = StructuredCloneData::write(cx, message)?;
|
||||
fn PostMessage(&self, cx: SafeJSContext, message: HandleValue) -> ErrorResult {
|
||||
let data = StructuredCloneData::write(*cx, message)?;
|
||||
let worker = self.worker.borrow().as_ref().unwrap().clone();
|
||||
let pipeline_id = self.upcast::<GlobalScope>().pipeline_id();
|
||||
let task = Box::new(task!(post_worker_message: move || {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue