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

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

Issue 2015463004: bluetooth: Use BluetoothUUID instead of string when sending uuids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo-request-device
Patch Set: Clean up Created 4 years, 7 months 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_allowed_devices_map.h
diff --git a/content/browser/bluetooth/bluetooth_allowed_devices_map.h b/content/browser/bluetooth/bluetooth_allowed_devices_map.h
index 8a4593f87fb7b20958ed8df5babb0246e615914a..13aa58038f614467ec4885157f0140a66d381957 100644
--- a/content/browser/bluetooth/bluetooth_allowed_devices_map.h
+++ b/content/browser/bluetooth/bluetooth_allowed_devices_map.h
@@ -58,21 +58,23 @@ class CONTENT_EXPORT BluetoothAllowedDevicesMap final {
// Returns true if the origin has previously been granted access to
// the service.
- bool IsOriginAllowedToAccessService(const url::Origin& origin,
- const std::string& device_id,
- const std::string& service_uuid) const;
+ bool IsOriginAllowedToAccessService(
+ const url::Origin& origin,
+ const std::string& device_id,
+ const device::BluetoothUUID& service_uuid) const;
private:
typedef std::map<std::string, std::string> DeviceAddressToIdMap;
typedef std::map<std::string, std::string> DeviceIdToAddressMap;
- typedef std::map<std::string, std::set<std::string>> DeviceIdToServicesMap;
+ typedef std::map<std::string, std::unordered_set<device::BluetoothUUID>>
+ DeviceIdToServicesMap;
// Returns an id guaranteed to be unique for the map. The id is randomly
// generated so that an origin can't guess the id used in another origin.
std::string GenerateDeviceId();
void AddUnionOfServicesTo(
const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options,
- std::set<std::string>* unionOfServices);
+ std::unordered_set<device::BluetoothUUID>* unionOfServices);
// TODO(ortuno): Now that there is only one instance of this class per frame
// and that this map gets destroyed when navigating consider removing the

Powered by Google App Engine
This is Rietveld 408576698