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

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

Issue 1922923002: bluetooth: Move requestDevice to mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-separate-tests-request-device
Patch Set: Remove debug log 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 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>

Powered by Google App Engine
This is Rietveld 408576698