diff options
author | Yerkebulan Tulibergenov <yerkebulan@gmail.com> | 2025-02-23 04:12:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-23 12:12:21 +0000 |
commit | 0383ba9a5b940de76823462ebc1b95298ea50903 (patch) | |
tree | 23c9539a19729c7ec065dbe6cfb9bb2843a2721c /components/script/dom/bluetooth/bluetooth.rs | |
parent | adb831eefea3b98369dab56fa1ef4f668900974c (diff) | |
download | servo-0383ba9a5b940de76823462ebc1b95298ea50903.tar.gz servo-0383ba9a5b940de76823462ebc1b95298ea50903.zip |
refactor: add CanGc as argument to Promise::resolve (#35616)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
Diffstat (limited to 'components/script/dom/bluetooth/bluetooth.rs')
-rw-r--r-- | components/script/dom/bluetooth/bluetooth.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/bluetooth/bluetooth.rs b/components/script/dom/bluetooth/bluetooth.rs index 7ea54e11d20..e1401b9d04e 100644 --- a/components/script/dom/bluetooth/bluetooth.rs +++ b/components/script/dom/bluetooth/bluetooth.rs @@ -589,7 +589,7 @@ impl AsyncBluetoothListener for Bluetooth { BluetoothResponse::RequestDevice(device) => { let mut device_instance_map = self.device_instance_map.borrow_mut(); if let Some(existing_device) = device_instance_map.get(&device.id.clone()) { - return promise.resolve_native(&**existing_device); + return promise.resolve_native(&**existing_device, can_gc); } let bt_device = BluetoothDevice::new( &self.global(), @@ -609,12 +609,12 @@ impl AsyncBluetoothListener for Bluetooth { }); // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice // Step 5. - promise.resolve_native(&bt_device); + promise.resolve_native(&bt_device, can_gc); }, // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability // Step 2 - 3. BluetoothResponse::GetAvailability(is_available) => { - promise.resolve_native(&is_available); + promise.resolve_native(&is_available, can_gc); }, _ => promise.reject_error(Error::Type("Something went wrong...".to_owned())), } @@ -655,7 +655,7 @@ impl PermissionAlgorithm for Bluetooth { // Step 3. if let PermissionState::Denied = status.get_state() { status.set_devices(Vec::new()); - return promise.resolve_native(status); + return promise.resolve_native(status, CanGc::note()); } // Step 4. @@ -727,7 +727,7 @@ impl PermissionAlgorithm for Bluetooth { // https://w3c.github.io/permissions/#dom-permissions-query // Step 7. - promise.resolve_native(status); + promise.resolve_native(status, CanGc::note()); } // https://webbluetoothcg.github.io/web-bluetooth/#request-the-bluetooth-permission |