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

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

Issue 2506813003: Use new wrapper types for web_bluetooth.mojom (Closed)
Patch Set: address comments 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..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);
}

Powered by Google App Engine
This is Rietveld 408576698