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..4034ba425a3957adf1ad7647029bc187682a93d3 100644 |
--- a/content/browser/bluetooth/bluetooth_blacklist.cc |
+++ b/content/browser/bluetooth/bluetooth_blacklist.cc |
@@ -86,12 +86,13 @@ 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())) { |
+ if (!filter->services) |
+ continue; |
+ for (const BluetoothUUID& service : filter->services.value()) { |
+ if (IsExcluded(service)) |
ortuno
2016/11/22 02:32:20
nit: In general, I would just keep the style (in t
juncai
2016/11/23 20:54:22
Done.
|
return true; |
- } |
} |
} |
return false; |
@@ -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); |
} |