Index: content/browser/bluetooth/bluetooth_blacklist.cc |
diff --git a/content/browser/bluetooth/bluetooth_blacklist.cc b/content/browser/bluetooth/bluetooth_blacklist.cc |
index a3c551e03348827e4ca9018cfe532e23b96a28d5..0546b52b96a96e43f22c1aed1bf57cc4e3ec9ed4 100644 |
--- a/content/browser/bluetooth/bluetooth_blacklist.cc |
+++ b/content/browser/bluetooth/bluetooth_blacklist.cc |
@@ -86,11 +86,12 @@ bool BluetoothBlacklist::IsExcluded(const BluetoothUUID& uuid) const { |
} |
bool BluetoothBlacklist::IsExcluded( |
- const mojo::Array<blink::mojom::WebBluetoothScanFilterPtr>& filters) { |
+ const std::vector<blink::mojom::WebBluetoothScanFilterPtr>& filters) { |
for (const blink::mojom::WebBluetoothScanFilterPtr& filter : filters) { |
- for (const base::Optional<BluetoothUUID>& service : filter->services) { |
- if (IsExcluded(service.value())) { |
- return true; |
+ if (filter->services) { |
ortuno
2016/11/21 04:42:31
Similarly here:
if (!filter->services) {
contin
juncai
2016/11/21 21:27:05
Test added for this.
Done.
|
+ for (const BluetoothUUID& service : filter->services.value()) { |
+ if (IsExcluded(service)) |
+ return true; |
} |
} |
} |
@@ -115,12 +116,10 @@ bool BluetoothBlacklist::IsExcludedFromWrites(const BluetoothUUID& uuid) const { |
void BluetoothBlacklist::RemoveExcludedUUIDs( |
blink::mojom::WebBluetoothRequestDeviceOptions* options) { |
- mojo::Array<base::Optional<BluetoothUUID>> |
- optional_services_blacklist_filtered; |
- for (const base::Optional<BluetoothUUID>& uuid : options->optional_services) { |
- if (!IsExcluded(uuid.value())) { |
+ std::vector<device::BluetoothUUID> optional_services_blacklist_filtered; |
+ for (const BluetoothUUID& uuid : options->optional_services) { |
+ if (!IsExcluded(uuid)) |
optional_services_blacklist_filtered.push_back(uuid); |
- } |
} |
options->optional_services = std::move(optional_services_blacklist_filtered); |
} |