Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: content/browser/bluetooth/bluetooth_blacklist.cc

Issue 2506813003: Use new wrapper types for web_bluetooth.mojom (Closed)
Patch Set: updated web_bluetooth_impl.cc Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698