aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bluetooth.rs
diff options
context:
space:
mode:
authorPrudhvi Rampey <gergteg777@gmail.com>2017-01-06 23:31:00 +0530
committerPrudhvi Rampey <gergteg777@gmail.com>2017-01-07 01:16:02 +0530
commit29340b7adf66eb0807d8eaac999f594f4859ad1c (patch)
treefe2273141b0a867de414286c69dcd4f6bbf65703 /components/script/dom/bluetooth.rs
parent7e3c9e21978b638b8f17192500251843f3743d1c (diff)
downloadservo-29340b7adf66eb0807d8eaac999f594f4859ad1c.tar.gz
servo-29340b7adf66eb0807d8eaac999f594f4859ad1c.zip
Cleaned up ripples due to MutJS to JS type change
Diffstat (limited to 'components/script/dom/bluetooth.rs')
-rw-r--r--components/script/dom/bluetooth.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs
index dcbb398a4ee..ce4e15103f4 100644
--- a/components/script/dom/bluetooth.rs
+++ b/components/script/dom/bluetooth.rs
@@ -15,7 +15,7 @@ use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::UnionTypes::StringOrUnsignedLong;
use dom::bindings::error::Error::{self, Network, NotFound, Security, Type};
use dom::bindings::error::Fallible;
-use dom::bindings::js::{MutJS, Root};
+use dom::bindings::js::{JS, Root};
use dom::bindings::refcounted::{Trusted, TrustedPromise};
use dom::bindings::reflector::{DomObject, reflect_dom_object};
use dom::bindings::str::DOMString;
@@ -83,7 +83,7 @@ impl<T: AsyncBluetoothListener + DomObject> BluetoothContext<T> {
#[dom_struct]
pub struct Bluetooth {
eventtarget: EventTarget,
- device_instance_map: DOMRefCell<HashMap<String, MutJS<BluetoothDevice>>>,
+ device_instance_map: DOMRefCell<HashMap<String, JS<BluetoothDevice>>>,
}
impl Bluetooth {
@@ -104,7 +104,7 @@ impl Bluetooth {
self.global().as_window().bluetooth_thread()
}
- pub fn get_device_map(&self) -> &DOMRefCell<HashMap<String, MutJS<BluetoothDevice>>> {
+ pub fn get_device_map(&self) -> &DOMRefCell<HashMap<String, JS<BluetoothDevice>>> {
&self.device_instance_map
}
@@ -466,13 +466,13 @@ 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(promise_cx, &existing_device.get());
+ return promise.resolve_native(promise_cx, &**existing_device);
}
let bt_device = BluetoothDevice::new(&self.global(),
DOMString::from(device.id.clone()),
device.name.map(DOMString::from),
&self);
- device_instance_map.insert(device.id, MutJS::new(&bt_device));
+ device_instance_map.insert(device.id, JS::from_ref(&bt_device));
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice
// Step 5.
promise.resolve_native(promise_cx, &bt_device);