mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Rename Promise::new to Promise::new_in_current_compartment
This commit is contained in:
parent
6fa1853bb1
commit
782b58587a
25 changed files with 93 additions and 51 deletions
|
@ -134,8 +134,9 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-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) {
|
||||
|
@ -167,8 +168,9 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-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) {
|
||||
|
@ -218,8 +220,9 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-startnotifications
|
||||
#[allow(unsafe_code)]
|
||||
fn StartNotifications(&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) {
|
||||
|
@ -255,8 +258,9 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-stopnotifications
|
||||
#[allow(unsafe_code)]
|
||||
fn StopNotifications(&self) -> Rc<Promise> {
|
||||
let p = Promise::new(&self.global());
|
||||
let p = unsafe { Promise::new_in_current_compartment(&self.global()) };
|
||||
let sender = response_async(&p, self);
|
||||
|
||||
// TODO: Step 3 - 4: Implement `active notification context set` for BluetoothRemoteGATTCharacteristic,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue