diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-10-07 07:52:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 07:52:09 -0500 |
commit | a6e4b5bb86ad707a0863acff87344ca4239cfd2c (patch) | |
tree | c820d9f2420c44cdfe29de97f1a710e7dc354bb7 /components/script/dom/bluetoothremotegattserver.rs | |
parent | e23959a7618e8e7b7ca20300a2afeb1ac77712f3 (diff) | |
parent | d8e92bb271a9f9dd87bf77e38cd820d01f2f0ae4 (diff) | |
download | servo-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/bluetoothremotegattserver.rs')
-rw-r--r-- | components/script/dom/bluetoothremotegattserver.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/components/script/dom/bluetoothremotegattserver.rs b/components/script/dom/bluetoothremotegattserver.rs index 3439ba53350..fe19651ebf4 100644 --- a/components/script/dom/bluetoothremotegattserver.rs +++ b/components/script/dom/bluetoothremotegattserver.rs @@ -8,7 +8,6 @@ use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods; use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::Error::{self, 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::DOMString; @@ -16,6 +15,7 @@ use dom::bluetooth::result_to_promise; use dom::bluetoothdevice::BluetoothDevice; use dom::bluetoothremotegattservice::BluetoothRemoteGATTService; use dom::bluetoothuuid::{BluetoothServiceUUID, BluetoothUUID}; +use dom::globalscope::GlobalScope; use dom::promise::Promise; use ipc_channel::ipc::{self, IpcSender}; use net_traits::bluetooth_thread::BluetoothMethodMsg; @@ -39,16 +39,14 @@ impl BluetoothRemoteGATTServer { } } - pub fn new(global: GlobalRef, device: &BluetoothDevice) -> Root<BluetoothRemoteGATTServer> { + pub fn new(global: &GlobalScope, device: &BluetoothDevice) -> Root<BluetoothRemoteGATTServer> { reflect_dom_object(box BluetoothRemoteGATTServer::new_inherited(device), - global, - BluetoothRemoteGATTServerBinding::Wrap) + global, + BluetoothRemoteGATTServerBinding::Wrap) } 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() } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect @@ -80,7 +78,7 @@ impl BluetoothRemoteGATTServer { let service = receiver.recv().unwrap(); match service { Ok(service) => { - Ok(BluetoothRemoteGATTService::new(self.global().r(), + Ok(BluetoothRemoteGATTService::new(&self.global(), &self.device.get(), DOMString::from(service.uuid), service.is_primary, @@ -112,7 +110,7 @@ impl BluetoothRemoteGATTServer { match services_vec { Ok(service_vec) => { Ok(service_vec.into_iter() - .map(|service| BluetoothRemoteGATTService::new(self.global().r(), + .map(|service| BluetoothRemoteGATTService::new(&self.global(), &self.device.get(), DOMString::from(service.uuid), service.is_primary, @@ -140,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(), self.connect()) } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-disconnect @@ -163,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(), self.get_primary_service(service)) } #[allow(unrooted_must_root)] @@ -171,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(), self.get_primary_services(service)) } } |