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

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

Issue 2506813003: Use new wrapper types for web_bluetooth.mojom (Closed)
Patch Set: merge master and resolve conflicts 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_blocklist.cc
diff --git a/content/browser/bluetooth/bluetooth_blocklist.cc b/content/browser/bluetooth/bluetooth_blocklist.cc
index 75bde0b6e3bde1a8acc6386b83b4f06b7cc900b0..4ba1dc1396212eb35b2d7c40f9aab4d6ea0dcf5d 100644
--- a/content/browser/bluetooth/bluetooth_blocklist.cc
+++ b/content/browser/bluetooth/bluetooth_blocklist.cc
@@ -86,10 +86,13 @@ bool BluetoothBlocklist::IsExcluded(const BluetoothUUID& uuid) const {
}
bool BluetoothBlocklist::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)) {
return true;
}
}
@@ -115,10 +118,9 @@ bool BluetoothBlocklist::IsExcludedFromWrites(const BluetoothUUID& uuid) const {
void BluetoothBlocklist::RemoveExcludedUUIDs(
blink::mojom::WebBluetoothRequestDeviceOptions* options) {
- mojo::Array<base::Optional<BluetoothUUID>>
- optional_services_blocklist_filtered;
- for (const base::Optional<BluetoothUUID>& uuid : options->optional_services) {
- if (!IsExcluded(uuid.value())) {
+ std::vector<device::BluetoothUUID> optional_services_blocklist_filtered;
+ for (const BluetoothUUID& uuid : options->optional_services) {
+ if (!IsExcluded(uuid)) {
optional_services_blocklist_filtered.push_back(uuid);
}
}

Powered by Google App Engine
This is Rietveld 408576698