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 2f585f8b9032bc974ce0706e96159971847e5dda..6d3315de8216d84134fcf0e6a894bd03363a9854 100644 |
--- a/content/browser/bluetooth/bluetooth_allowed_devices_map.h |
+++ b/content/browser/bluetooth/bluetooth_allowed_devices_map.h |
@@ -11,6 +11,7 @@ |
#include <vector> |
#include "content/common/content_export.h" |
+#include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom.h" |
#include "url/origin.h" |
namespace device { |
@@ -32,12 +33,12 @@ class CONTENT_EXPORT BluetoothAllowedDevicesMap final { |
~BluetoothAllowedDevicesMap(); |
// Adds the Bluetooth Device with |device_address| to the map of allowed |
- // devices for that origin. Generates and returns a device id. |
+ // devices for that origin. Generates and returns a device id. Because |
+ // unique origins generate the same hash, unique origins are not supported. |
Jeffrey Yasskin
2016/05/13 04:41:58
Does "not supported" mean they'll CHECK-fail, retu
ortuno
2016/05/13 20:11:17
Added comment.
|
const std::string& AddDevice( |
const url::Origin& origin, |
const std::string& device_address, |
- const std::vector<BluetoothScanFilter>& filters, |
- const std::vector<device::BluetoothUUID>& optional_services); |
+ const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options); |
// Removes the Bluetooth Device with |device_address| from the map of allowed |
// devices for |origin|. |
@@ -69,10 +70,13 @@ class CONTENT_EXPORT BluetoothAllowedDevicesMap final { |
// generated so that an origin can't guess the id used in another origin. |
std::string GenerateDeviceId(); |
void AddUnionOfServicesTo( |
- const std::vector<BluetoothScanFilter>& filters, |
- const std::vector<device::BluetoothUUID>& optional_services, |
+ const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options, |
std::set<std::string>* 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 |
+ // origin mapping. |
+ // http://crbug.com/610343 |
std::map<url::Origin, DeviceAddressToIdMap> |
origin_to_device_address_to_id_map_; |
std::map<url::Origin, DeviceIdToAddressMap> |