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

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

Issue 2510323002: bluetooth: Implement acceptAllDevices (Closed)
Patch Set: clean up Created 4 years 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
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/bluetooth/bluetooth_allowed_devices_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_allowed_devices_map.cc
diff --git a/content/browser/bluetooth/bluetooth_allowed_devices_map.cc b/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
index a0173a5e3644e0eae7285706f6e1f1af7438d4cf..767ea23886ee8e530b0b47efdd90ced845d11dc3 100644
--- a/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
+++ b/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
@@ -166,15 +166,18 @@ void BluetoothAllowedDevicesMap::AddUnionOfServicesTo(
const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options,
std::unordered_set<BluetoothUUID, device::BluetoothUUIDHash>*
unionOfServices) {
- for (const auto& filter : options->filters) {
- if (!filter->services) {
- continue;
- }
-
- for (const BluetoothUUID& uuid : filter->services.value()) {
- unionOfServices->insert(uuid);
+ if (options->filters) {
+ for (const auto& filter : options->filters.value()) {
+ if (!filter->services) {
+ continue;
+ }
+
+ for (const BluetoothUUID& uuid : filter->services.value()) {
+ unionOfServices->insert(uuid);
+ }
}
}
+
for (const BluetoothUUID& uuid : options->optional_services) {
unionOfServices->insert(uuid);
}
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/bluetooth/bluetooth_allowed_devices_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698