mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
@ -8,10 +8,11 @@ use crate::dom::bindings::error::{Error, Fallible};
|
|||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::script_runtime::JSContext;
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::default::{Rect, Size2D};
|
||||
use ipc_channel::ipc::IpcSharedMemory;
|
||||
use js::jsapi::{Heap, JSContext, JSObject};
|
||||
use js::jsapi::{Heap, JSObject};
|
||||
use js::rust::Runtime;
|
||||
use js::typedarray::{CreateWith, Uint8ClampedArray};
|
||||
use std::borrow::Cow;
|
||||
|
@ -131,7 +132,7 @@ impl ImageData {
|
|||
#[allow(unsafe_code)]
|
||||
#[allow(unused_variables)]
|
||||
pub unsafe fn Constructor_(
|
||||
cx: *mut JSContext,
|
||||
cx: JSContext,
|
||||
global: &GlobalScope,
|
||||
jsobject: *mut JSObject,
|
||||
width: u32,
|
||||
|
@ -183,9 +184,8 @@ impl ImageDataMethods for ImageData {
|
|||
self.height
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-imagedata-data
|
||||
unsafe fn Data(&self, _: *mut JSContext) -> NonNull<JSObject> {
|
||||
fn Data(&self, _: JSContext) -> NonNull<JSObject> {
|
||||
NonNull::new(self.data.get()).expect("got a null pointer")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue