mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -535,12 +535,8 @@ impl From<BluetoothError> for Error {
|
|||
|
||||
impl BluetoothMethods for Bluetooth {
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice
|
||||
fn RequestDevice(&self, option: &RequestDeviceOptions) -> Rc<Promise> {
|
||||
let in_compartment_proof = AlreadyInCompartment::assert(&self.global());
|
||||
let p = Promise::new_in_current_compartment(
|
||||
&self.global(),
|
||||
InCompartment::Already(&in_compartment_proof),
|
||||
);
|
||||
fn RequestDevice(&self, option: &RequestDeviceOptions, comp: InCompartment) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
// Step 1.
|
||||
if (option.filters.is_some() && option.acceptAllDevices) ||
|
||||
(option.filters.is_none() && !option.acceptAllDevices)
|
||||
|
@ -557,12 +553,8 @@ impl BluetoothMethods for Bluetooth {
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability
|
||||
fn GetAvailability(&self) -> Rc<Promise> {
|
||||
let in_compartment_proof = AlreadyInCompartment::assert(&self.global());
|
||||
let p = Promise::new_in_current_compartment(
|
||||
&self.global(),
|
||||
InCompartment::Already(&in_compartment_proof),
|
||||
);
|
||||
fn GetAvailability(&self, comp: InCompartment) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
// Step 1. We did not override the method
|
||||
// Step 2 - 3. in handle_response
|
||||
let sender = response_async(&p, self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue