diff options
author | Aron Zwaan <aronzwaan@gmail.com> | 2019-03-30 21:03:20 +0100 |
---|---|---|
committer | Aron Zwaan <aronzwaan@gmail.com> | 2019-04-03 20:45:30 +0200 |
commit | 782b58587acc754c7b378a84a4b51405738bb081 (patch) | |
tree | a530be8317cbda75e8d81679a7abc9fbd6379541 /components/script/dom/bluetooth.rs | |
parent | 6fa1853bb1e9bc80271c5259a8d2ed7799a0d6ff (diff) | |
download | servo-782b58587acc754c7b378a84a4b51405738bb081.tar.gz servo-782b58587acc754c7b378a84a4b51405738bb081.zip |
Rename Promise::new to Promise::new_in_current_compartment
Diffstat (limited to 'components/script/dom/bluetooth.rs')
-rw-r--r-- | components/script/dom/bluetooth.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index 4b541d4b60a..c218fbce27a 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -278,6 +278,7 @@ pub fn response_async<T: AsyncBluetoothListener + DomObject + 'static>( } // https://webbluetoothcg.github.io/web-bluetooth/#getgattchildren +#[allow(unsafe_code)] pub fn get_gatt_children<T, F>( attribute: &T, single: bool, @@ -291,7 +292,7 @@ where T: AsyncBluetoothListener + DomObject + 'static, F: FnOnce(StringOrUnsignedLong) -> Fallible<UUID>, { - let p = Promise::new(&attribute.global()); + let p = unsafe { Promise::new_in_current_compartment(&attribute.global()) }; let result_uuid = if let Some(u) = uuid { // Step 1. @@ -530,8 +531,9 @@ impl From<BluetoothError> for Error { impl BluetoothMethods for Bluetooth { // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice + #[allow(unsafe_code)] fn RequestDevice(&self, option: &RequestDeviceOptions) -> Rc<Promise> { - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; // Step 1. if (option.filters.is_some() && option.acceptAllDevices) || (option.filters.is_none() && !option.acceptAllDevices) @@ -548,8 +550,9 @@ impl BluetoothMethods for Bluetooth { } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability + #[allow(unsafe_code)] fn GetAvailability(&self) -> Rc<Promise> { - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; // Step 1. We did not override the method // Step 2 - 3. in handle_response let sender = response_async(&p, self); |