diff options
Diffstat (limited to 'components/script/dom/bluetoothremotegattdescriptor.rs')
-rw-r--r-- | components/script/dom/bluetoothremotegattdescriptor.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/bluetoothremotegattdescriptor.rs b/components/script/dom/bluetoothremotegattdescriptor.rs index 983ee355de4..000acdecb6c 100644 --- a/components/script/dom/bluetoothremotegattdescriptor.rs +++ b/components/script/dom/bluetoothremotegattdescriptor.rs @@ -93,8 +93,9 @@ impl BluetoothRemoteGATTDescriptorMethods for BluetoothRemoteGATTDescriptor { } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-readvalue + #[allow(unsafe_code)] fn ReadValue(&self) -> Rc<Promise> { - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; // Step 1. if uuid_is_blocklisted(self.uuid.as_ref(), Blocklist::Reads) { @@ -125,8 +126,9 @@ impl BluetoothRemoteGATTDescriptorMethods for BluetoothRemoteGATTDescriptor { } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-writevalue + #[allow(unsafe_code)] fn WriteValue(&self, value: ArrayBufferViewOrArrayBuffer) -> Rc<Promise> { - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; // Step 1. if uuid_is_blocklisted(self.uuid.as_ref(), Blocklist::Writes) { |