diff options
author | marmeladema <xademax@gmail.com> | 2019-07-21 22:22:44 +0100 |
---|---|---|
committer | marmeladema <xademax@gmail.com> | 2019-07-24 08:18:22 +0100 |
commit | 808fa65aef163879b82baddc4af0a5445f806c81 (patch) | |
tree | 905750f71cc7c4d5faebcc126ac1864889aa0179 /components/script/dom/bluetooth.rs | |
parent | 2fb3f1f98327ee1de698dfed83124350f58ff52a (diff) | |
download | servo-808fa65aef163879b82baddc4af0a5445f806c81.tar.gz servo-808fa65aef163879b82baddc4af0a5445f806c81.zip |
Convert internal methods to handle safe JSContext instead of raw JSContext
Diffstat (limited to 'components/script/dom/bluetooth.rs')
-rw-r--r-- | components/script/dom/bluetooth.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index 7484e476416..4a5a9af9c43 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -30,6 +30,7 @@ use crate::dom::eventtarget::EventTarget; use crate::dom::globalscope::GlobalScope; use crate::dom::permissions::{get_descriptor_permission_state, PermissionAlgorithm}; use crate::dom::promise::Promise; +use crate::script_runtime::JSContext as SafeJSContext; use crate::task::TaskOnce; use dom_struct::dom_struct; use ipc_channel::ipc::{self, IpcSender}; @@ -625,7 +626,8 @@ impl PermissionAlgorithm for Bluetooth { .handle_mut() .set(ObjectValue(permission_descriptor_obj)); unsafe { - match BluetoothPermissionDescriptor::new(cx, property.handle()) { + match BluetoothPermissionDescriptor::new(SafeJSContext::from_ptr(cx), property.handle()) + { Ok(ConversionResult::Success(descriptor)) => Ok(descriptor), Ok(ConversionResult::Failure(error)) => Err(Error::Type(error.into_owned())), Err(_) => Err(Error::Type(String::from(BT_DESC_CONVERSION_ERROR))), |