aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bluetoothremotegattservice.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2024-10-22 05:35:20 -0400
committerGitHub <noreply@github.com>2024-10-22 09:35:20 +0000
commit575e8855294a9ee2094b110a7c1fea868e69251e (patch)
tree261ab3e890b9125e9e08f97366de34213eb67467 /components/script/dom/bluetoothremotegattservice.rs
parentedc304854ff18bc686f8e2adc6cb64cbad181598 (diff)
downloadservo-575e8855294a9ee2094b110a7c1fea868e69251e.tar.gz
servo-575e8855294a9ee2094b110a7c1fea868e69251e.zip
Mark promise creation methods with CanGc (#33928)
* Add CanGc annotations to promise constructor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc arguments for Promise::new_in_current_realm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix out-of-order entries. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from Promise::new. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Suppress clippy warning. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/bluetoothremotegattservice.rs')
-rw-r--r--components/script/dom/bluetoothremotegattservice.rs20
1 files changed, 17 insertions, 3 deletions
diff --git a/components/script/dom/bluetoothremotegattservice.rs b/components/script/dom/bluetoothremotegattservice.rs
index abb65d83c2a..76158826b78 100644
--- a/components/script/dom/bluetoothremotegattservice.rs
+++ b/components/script/dom/bluetoothremotegattservice.rs
@@ -19,6 +19,7 @@ use crate::dom::bluetoothuuid::{BluetoothCharacteristicUUID, BluetoothServiceUUI
use crate::dom::eventtarget::EventTarget;
use crate::dom::globalscope::GlobalScope;
use crate::dom::promise::Promise;
+use crate::script_runtime::CanGc;
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice
#[dom_struct]
@@ -84,7 +85,11 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
}
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getcharacteristic
- fn GetCharacteristic(&self, characteristic: BluetoothCharacteristicUUID) -> Rc<Promise> {
+ fn GetCharacteristic(
+ &self,
+ characteristic: BluetoothCharacteristicUUID,
+ can_gc: CanGc,
+ ) -> Rc<Promise> {
get_gatt_children(
self,
true,
@@ -93,6 +98,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
self.get_instance_id(),
self.Device().get_gatt().Connected(),
GATTType::Characteristic,
+ can_gc,
)
}
@@ -100,6 +106,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
fn GetCharacteristics(
&self,
characteristic: Option<BluetoothCharacteristicUUID>,
+ can_gc: CanGc,
) -> Rc<Promise> {
get_gatt_children(
self,
@@ -109,11 +116,12 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
self.get_instance_id(),
self.Device().get_gatt().Connected(),
GATTType::Characteristic,
+ can_gc,
)
}
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservice
- fn GetIncludedService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
+ fn GetIncludedService(&self, service: BluetoothServiceUUID, can_gc: CanGc) -> Rc<Promise> {
get_gatt_children(
self,
false,
@@ -122,11 +130,16 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
self.get_instance_id(),
self.Device().get_gatt().Connected(),
GATTType::IncludedService,
+ can_gc,
)
}
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservices
- fn GetIncludedServices(&self, service: Option<BluetoothServiceUUID>) -> Rc<Promise> {
+ fn GetIncludedServices(
+ &self,
+ service: Option<BluetoothServiceUUID>,
+ can_gc: CanGc,
+ ) -> Rc<Promise> {
get_gatt_children(
self,
false,
@@ -135,6 +148,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
self.get_instance_id(),
self.Device().get_gatt().Connected(),
GATTType::IncludedService,
+ can_gc,
)
}