mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Convert internal methods to handle safe JSContext instead of raw JSContext
This commit is contained in:
parent
2fb3f1f983
commit
808fa65aef
4 changed files with 151 additions and 139 deletions
|
@ -28,6 +28,7 @@ use crate::dom::webgl2renderingcontext::WebGL2RenderingContext;
|
|||
use crate::dom::webglrenderingcontext::{
|
||||
LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext,
|
||||
};
|
||||
use crate::script_runtime::JSContext as SafeJSContext;
|
||||
use base64;
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg, FromScriptMsg};
|
||||
use canvas_traits::webgl::{GLContextAttributes, WebGLVersion};
|
||||
|
@ -263,7 +264,7 @@ impl HTMLCanvasElement {
|
|||
cx: *mut JSContext,
|
||||
options: HandleValue,
|
||||
) -> Option<GLContextAttributes> {
|
||||
match WebGLContextAttributes::new(cx, options) {
|
||||
match WebGLContextAttributes::new(SafeJSContext::from_ptr(cx), options) {
|
||||
Ok(ConversionResult::Success(ref attrs)) => Some(From::from(attrs)),
|
||||
Ok(ConversionResult::Failure(ref error)) => {
|
||||
throw_type_error(cx, &error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue