Index: content/browser/bluetooth/bluetooth_blacklist.cc |
diff --git a/content/browser/bluetooth/bluetooth_blacklist.cc b/content/browser/bluetooth/bluetooth_blacklist.cc |
index 44ecab449176b49eedc7dd66d35064deb5fe77d3..830822f183fc3a45196cf14997b999d12cb27a2c 100644 |
--- a/content/browser/bluetooth/bluetooth_blacklist.cc |
+++ b/content/browser/bluetooth/bluetooth_blacklist.cc |
@@ -32,7 +32,7 @@ BluetoothBlacklist& BluetoothBlacklist::Get() { |
return g_singleton.Get(); |
} |
-void BluetoothBlacklist::Add(const device::BluetoothUUID& uuid, Value value) { |
+void BluetoothBlacklist::Add(const BluetoothUUID& uuid, Value value) { |
CHECK(uuid.IsValid()); |
auto insert_result = blacklisted_uuids_.insert(std::make_pair(uuid, value)); |
bool inserted = insert_result.second; |
@@ -87,8 +87,8 @@ bool BluetoothBlacklist::IsExcluded(const BluetoothUUID& uuid) const { |
bool BluetoothBlacklist::IsExcluded( |
const mojo::Array<blink::mojom::WebBluetoothScanFilterPtr>& filters) { |
for (const blink::mojom::WebBluetoothScanFilterPtr& filter : filters) { |
- for (const std::string& service : filter->services) { |
- if (IsExcluded(BluetoothUUID(service))) { |
+ for (const std::unique_ptr<BluetoothUUID>& service : filter->services) { |
+ if (IsExcluded(*service)) { |
return true; |
} |
} |
@@ -114,10 +114,13 @@ bool BluetoothBlacklist::IsExcludedFromWrites(const BluetoothUUID& uuid) const { |
void BluetoothBlacklist::RemoveExcludedUUIDs( |
blink::mojom::WebBluetoothRequestDeviceOptions* options) { |
- mojo::Array<mojo::String> optional_services_blacklist_filtered; |
- for (const std::string& uuid : options->optional_services) { |
- if (!IsExcluded(BluetoothUUID(uuid))) { |
- optional_services_blacklist_filtered.push_back(uuid); |
+ mojo::Array<std::unique_ptr<BluetoothUUID>> |
+ optional_services_blacklist_filtered; |
+ for (const std::unique_ptr<BluetoothUUID>& uuid : |
+ options->optional_services) { |
+ if (!IsExcluded(*uuid)) { |
+ optional_services_blacklist_filtered.push_back( |
+ base::WrapUnique(new BluetoothUUID(*uuid))); |
} |
} |
options->optional_services = std::move(optional_services_blacklist_filtered); |