Make bluetooth::result_to_promise take a &GlobalScope

This commit is contained in:
Anthony Ramine 2016-10-02 17:11:29 +02:00
parent 9183525192
commit d4fccbace4
5 changed files with 16 additions and 17 deletions

View file

@ -138,7 +138,7 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
#[allow(unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect
fn Connect(&self) -> Rc<Promise> {
result_to_promise(self.global().r(), self.connect())
result_to_promise(&self.global_scope(), self.connect())
}
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-disconnect
@ -161,7 +161,7 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
#[allow(unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservice
fn GetPrimaryService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
result_to_promise(self.global().r(), self.get_primary_service(service))
result_to_promise(&self.global_scope(), self.get_primary_service(service))
}
#[allow(unrooted_must_root)]
@ -169,6 +169,6 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
fn GetPrimaryServices(&self,
service: Option<BluetoothServiceUUID>)
-> Rc<Promise> {
result_to_promise(self.global().r(), self.get_primary_services(service))
result_to_promise(&self.global_scope(), self.get_primary_services(service))
}
}