aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bluetoothremotegattcharacteristic.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-10-07 07:52:09 -0500
committerGitHub <noreply@github.com>2016-10-07 07:52:09 -0500
commita6e4b5bb86ad707a0863acff87344ca4239cfd2c (patch)
treec820d9f2420c44cdfe29de97f1a710e7dc354bb7 /components/script/dom/bluetoothremotegattcharacteristic.rs
parente23959a7618e8e7b7ca20300a2afeb1ac77712f3 (diff)
parentd8e92bb271a9f9dd87bf77e38cd820d01f2f0ae4 (diff)
downloadservo-a6e4b5bb86ad707a0863acff87344ca4239cfd2c.tar.gz
servo-a6e4b5bb86ad707a0863acff87344ca4239cfd2c.zip
Auto merge of #13596 - nox:inline, r=Ms2ger
Get rid of dom::bindings::global Globals in that PR are now represented by the fake IDL interface `GlobalScope`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13596) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bluetoothremotegattcharacteristic.rs')
-rw-r--r--components/script/dom/bluetoothremotegattcharacteristic.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/components/script/dom/bluetoothremotegattcharacteristic.rs b/components/script/dom/bluetoothremotegattcharacteristic.rs
index 6b7ba1dcfad..95b26ff66c1 100644
--- a/components/script/dom/bluetoothremotegattcharacteristic.rs
+++ b/components/script/dom/bluetoothremotegattcharacteristic.rs
@@ -14,7 +14,6 @@ use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::Bluetoot
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
use dom::bindings::error::{ErrorResult, Fallible};
use dom::bindings::error::Error::{self, InvalidModification, Network, NotSupported, Security};
-use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, MutHeap, Root};
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::{ByteString, DOMString};
@@ -23,6 +22,7 @@ use dom::bluetoothcharacteristicproperties::BluetoothCharacteristicProperties;
use dom::bluetoothremotegattdescriptor::BluetoothRemoteGATTDescriptor;
use dom::bluetoothremotegattservice::BluetoothRemoteGATTService;
use dom::bluetoothuuid::{BluetoothDescriptorUUID, BluetoothUUID};
+use dom::globalscope::GlobalScope;
use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
@@ -59,7 +59,7 @@ impl BluetoothRemoteGATTCharacteristic {
}
}
- pub fn new(global: GlobalRef,
+ pub fn new(global: &GlobalScope,
service: &BluetoothRemoteGATTService,
uuid: DOMString,
properties: &BluetoothCharacteristicProperties,
@@ -74,9 +74,7 @@ impl BluetoothRemoteGATTCharacteristic {
}
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothMethodMsg> {
- let global_root = self.global();
- let global_ref = global_root.r();
- global_ref.as_window().bluetooth_thread()
+ self.global().as_window().bluetooth_thread()
}
fn get_instance_id(&self) -> String {
@@ -95,7 +93,7 @@ impl BluetoothRemoteGATTCharacteristic {
let descriptor = receiver.recv().unwrap();
match descriptor {
Ok(descriptor) => {
- Ok(BluetoothRemoteGATTDescriptor::new(self.global().r(),
+ Ok(BluetoothRemoteGATTDescriptor::new(&self.global(),
self,
DOMString::from(descriptor.uuid),
descriptor.instance_id))
@@ -126,7 +124,7 @@ impl BluetoothRemoteGATTCharacteristic {
match descriptors_vec {
Ok(descriptor_vec) => {
Ok(descriptor_vec.into_iter()
- .map(|desc| BluetoothRemoteGATTDescriptor::new(self.global().r(),
+ .map(|desc| BluetoothRemoteGATTDescriptor::new(&self.global(),
self,
DOMString::from(desc.uuid),
desc.instance_id))
@@ -214,7 +212,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
#[allow(unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-getdescriptor
fn GetDescriptor(&self, descriptor: BluetoothDescriptorUUID) -> Rc<Promise> {
- result_to_promise(self.global().r(), self.get_descriptor(descriptor))
+ result_to_promise(&self.global(), self.get_descriptor(descriptor))
}
#[allow(unrooted_must_root)]
@@ -222,7 +220,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
fn GetDescriptors(&self,
descriptor: Option<BluetoothDescriptorUUID>)
-> Rc<Promise> {
- result_to_promise(self.global().r(), self.get_descriptors(descriptor))
+ result_to_promise(&self.global(), self.get_descriptors(descriptor))
}
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-value
@@ -233,12 +231,12 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
#[allow(unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-readvalue
fn ReadValue(&self) -> Rc<Promise> {
- result_to_promise(self.global().r(), self.read_value())
+ result_to_promise(&self.global(), self.read_value())
}
#[allow(unrooted_must_root)]
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-writevalue
fn WriteValue(&self, value: Vec<u8>) -> Rc<Promise> {
- result_to_promise(self.global().r(), self.write_value(value))
+ result_to_promise(&self.global(), self.write_value(value))
}
}