Skip to content

Commit

Permalink
Add a realm
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 9, 2020
1 parent f721113 commit c89f79b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/script/dom/xrinputsourceschangeevent.rs
Expand Up @@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use crate::compartments::enter_realm;
use crate::dom::bindings::codegen::Bindings::EventBinding::EventBinding::EventMethods;
use crate::dom::bindings::codegen::Bindings::XRInputSourcesChangeEventBinding::{
self, XRInputSourcesChangeEventMethods,
Expand Down Expand Up @@ -62,7 +63,7 @@ impl XRInputSourcesChangeEvent {
let event = changeevent.upcast::<Event>();
event.init_event(type_, bubbles, cancelable);
}

let _ac = enter_realm(&*global);
let cx = global.get_cx();
unsafe {
rooted!(in(*cx) let mut added_val = UndefinedValue());
Expand Down
2 changes: 2 additions & 0 deletions components/script/dom/xrviewerpose.rs
Expand Up @@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use crate::compartments::enter_realm;
use crate::dom::bindings::codegen::Bindings::XRViewBinding::XREye;
use crate::dom::bindings::codegen::Bindings::XRViewerPoseBinding;
use crate::dom::bindings::codegen::Bindings::XRViewerPoseBinding::XRViewerPoseMethods;
Expand Down Expand Up @@ -40,6 +41,7 @@ impl XRViewerPose {
session: &XRSession,
pose: ApiViewerPose,
) -> DomRoot<XRViewerPose> {
let _ac = enter_realm(&*global);
rooted_vec!(let mut views);
session.with_session(|s| match s.views() {
Views::Inline => views.push(XRView::new(
Expand Down

0 comments on commit c89f79b

Please sign in to comment.