Auto merge of #11652 - szeged:blacklistfix, r=jdm

Add blacklist check to GetIncludedService(s) functions

Somehow we missed it from our previous blacklist PR, to add blacklist check for the GetIncludedService() and GetIncludedServices() functions. Link for the spec: https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservice

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because there are no webbluetooth test api implementation yet.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11652)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-06-08 13:31:41 -05:00
commit 52cfd888ea

View file

@ -170,6 +170,9 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
service: BluetoothServiceUUID)
-> Fallible<Root<BluetoothRemoteGATTService>> {
let uuid = try!(BluetoothUUID::GetService(self.global().r(), service)).to_string();
if uuid_is_blacklisted(uuid.as_ref(), Blacklist::All) {
return Err(Security)
}
let (sender, receiver) = ipc::channel().unwrap();
self.get_bluetooth_thread().send(
BluetoothMethodMsg::GetIncludedService(self.get_instance_id(),
@ -196,7 +199,12 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
-> Fallible<Vec<Root<BluetoothRemoteGATTService>>> {
let mut uuid: Option<String> = None;
if let Some(s) = service {
uuid = Some(try!(BluetoothUUID::GetService(self.global().r(), s)).to_string())
uuid = Some(try!(BluetoothUUID::GetService(self.global().r(), s)).to_string());
if let Some(ref uuid) = uuid {
if uuid_is_blacklisted(uuid.as_ref(), Blacklist::All) {
return Err(Security)
}
}
};
let (sender, receiver) = ipc::channel().unwrap();
self.get_bluetooth_thread().send(