diff options
author | Zakor Gyula <zakorgy@inf.u-szeged.hu> | 2017-02-10 13:10:04 +0100 |
---|---|---|
committer | Attila Dusnoki <dati91@gmail.com> | 2017-02-13 14:58:12 +0100 |
commit | 3ec9f0bab9807ccaecd3f4b93d891f7cab82fbc5 (patch) | |
tree | 2cf9c24d78a31732a6fd9e62d3d2ae7c5d1cbe7c /components/script/dom/bluetooth.rs | |
parent | 0b713fd689e118be8e086e47c6a10baf24c14c85 (diff) | |
download | servo-3ec9f0bab9807ccaecd3f4b93d891f7cab82fbc5.tar.gz servo-3ec9f0bab9807ccaecd3f4b93d891f7cab82fbc5.zip |
Fix comments, and lesser modifications
Diffstat (limited to 'components/script/dom/bluetooth.rs')
-rw-r--r-- | components/script/dom/bluetooth.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index b932046acc3..e681ce5b1da 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -580,8 +580,7 @@ impl PermissionAlgorithm for Bluetooth { fn permission_query(cx: *mut JSContext, promise: &Rc<Promise>, descriptor: &BluetoothPermissionDescriptor, status: &BluetoothPermissionResult) { - // Step 1. - // TODO: `environment settings object` is not implemented in Servo yet. + // Step 1: We are not using the `global` variable. // Step 2. status.set_state(get_descriptor_permission_state(status.get_query(), None)); @@ -615,11 +614,12 @@ impl PermissionAlgorithm for Bluetooth { } } let device_id = String::from(allowed_device.deviceId.as_ref()); + + // Step 6.2. if let Some(ref filters) = descriptor.filters { let mut scan_filters: Vec<BluetoothScanfilter> = Vec::new(); - // NOTE(zakorgy): This canonicalizing step is missing from the specification. - // But there is an issue for this: https://github.com/WebBluetoothCG/web-bluetooth/issues/347 + // Step 6.2.1. for filter in filters { match canonicalize_filter(&filter) { Ok(f) => scan_filters.push(f), @@ -627,7 +627,7 @@ impl PermissionAlgorithm for Bluetooth { } } - // Step 6.2. + // Step 6.2.2. // Instead of creating an internal slot we send an ipc message to the Bluetooth thread // to check if one of the filters matches. let (sender, receiver) = ipc::channel().unwrap(); @@ -643,7 +643,7 @@ impl PermissionAlgorithm for Bluetooth { }; } - // Step 6.4. + // Step 6.3. // TODO: Implement this correctly, not just using device ids here. // https://webbluetoothcg.github.io/web-bluetooth/#get-the-bluetoothdevice-representing if let Some(ref device) = device_map.get(&device_id) { @@ -659,8 +659,7 @@ impl PermissionAlgorithm for Bluetooth { promise.resolve_native(cx, status); } - // NOTE(zakorgy): There is no link for this algorithm until this PR for the spec is pending: - // https://github.com/WebBluetoothCG/web-bluetooth/pull/349 + // https://webbluetoothcg.github.io/web-bluetooth/#request-the-bluetooth-permission fn permission_request(cx: *mut JSContext, promise: &Rc<Promise>, descriptor: &BluetoothPermissionDescriptor, status: &BluetoothPermissionResult) { |