aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/vrframedata.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/vrframedata.rs')
-rw-r--r--components/script/dom/vrframedata.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/vrframedata.rs b/components/script/dom/vrframedata.rs
index ebd0c8cc24f..08acd74bb42 100644
--- a/components/script/dom/vrframedata.rs
+++ b/components/script/dom/vrframedata.rs
@@ -58,10 +58,12 @@ impl VRFrameData {
VRFrameDataBinding::Wrap,
);
let cx = global.get_cx();
- create_typed_array(cx, &matrix, &root.left_proj);
- create_typed_array(cx, &matrix, &root.left_view);
- create_typed_array(cx, &matrix, &root.right_proj);
- create_typed_array(cx, &matrix, &root.right_view);
+ unsafe {
+ create_typed_array(cx, &matrix, &root.left_proj);
+ create_typed_array(cx, &matrix, &root.left_view);
+ create_typed_array(cx, &matrix, &root.right_proj);
+ create_typed_array(cx, &matrix, &root.right_view);
+ }
root
}
@@ -73,11 +75,9 @@ impl VRFrameData {
/// FIXME(#22526) this should be in a better place
#[allow(unsafe_code)]
-pub fn create_typed_array(cx: *mut JSContext, src: &[f32], dst: &Heap<*mut JSObject>) {
+pub unsafe fn create_typed_array(cx: *mut JSContext, src: &[f32], dst: &Heap<*mut JSObject>) {
rooted!(in (cx) let mut array = ptr::null_mut::<JSObject>());
- unsafe {
- let _ = Float32Array::create(cx, CreateWith::Slice(src), array.handle_mut());
- }
+ let _ = Float32Array::create(cx, CreateWith::Slice(src), array.handle_mut());
(*dst).set(array.get());
}