mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use the newly added inCompartments option everywhere it can be
This commit is contained in:
parent
0b29caa554
commit
292d468cd1
22 changed files with 216 additions and 259 deletions
|
@ -2,7 +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::{AlreadyInCompartment, InCompartment};
|
||||
use crate::compartments::InCompartment;
|
||||
use crate::dom::bindings::codegen::Bindings::NavigatorBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorMethods;
|
||||
use crate::dom::bindings::error::Error;
|
||||
|
@ -151,12 +151,8 @@ impl NavigatorMethods for Navigator {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/webvr/spec/1.1/#navigator-getvrdisplays-attribute
|
||||
fn GetVRDisplays(&self) -> Rc<Promise> {
|
||||
let in_compartment_proof = AlreadyInCompartment::assert(&self.global());
|
||||
let promise = Promise::new_in_current_compartment(
|
||||
&self.global(),
|
||||
InCompartment::Already(&in_compartment_proof),
|
||||
);
|
||||
fn GetVRDisplays(&self, comp: InCompartment) -> Rc<Promise> {
|
||||
let promise = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
let displays = self.Xr().get_displays();
|
||||
match displays {
|
||||
Ok(displays) => promise.resolve_native(&displays),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue