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

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: Fix merge conflict Created 4 years, 6 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
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_allowed_devices_map.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.h
diff --git a/content/browser/bluetooth/bluetooth_allowed_devices_map.h b/content/browser/bluetooth/bluetooth_allowed_devices_map.h
index 8a4593f87fb7b20958ed8df5babb0246e615914a..396f7293c8ab11da015817caa400b546df1b3eb1 100644
--- a/content/browser/bluetooth/bluetooth_allowed_devices_map.h
+++ b/content/browser/bluetooth/bluetooth_allowed_devices_map.h
@@ -8,6 +8,7 @@
#include <map>
#include <memory>
#include <set>
+#include <unordered_set>
#include <vector>
#include "content/common/content_export.h"
@@ -58,21 +59,26 @@ 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, device::BluetoothUUIDHash>>
+ 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, device::BluetoothUUIDHash>*
+ 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
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_allowed_devices_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698