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

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

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: Lint 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.cc
diff --git a/content/browser/bluetooth/bluetooth_allowed_devices_map.cc b/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
index 1f9b2cfd755cc00b7b5685266369e9a2b4940b5d..0634f8f37e58bf0439ff78a81884ce1c45c110c6 100644
--- a/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
+++ b/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
@@ -129,8 +129,8 @@ const std::string& BluetoothAllowedDevicesMap::GetDeviceAddress(
bool BluetoothAllowedDevicesMap::IsOriginAllowedToAccessService(
const url::Origin& origin,
const std::string& device_id,
- const std::string& service_uuid) const {
- if (BluetoothBlacklist::Get().IsExcluded(BluetoothUUID(service_uuid))) {
+ const BluetoothUUID& service_uuid) const {
+ if (BluetoothBlacklist::Get().IsExcluded(service_uuid)) {
return false;
}
@@ -159,14 +159,15 @@ std::string BluetoothAllowedDevicesMap::GenerateDeviceId() {
void BluetoothAllowedDevicesMap::AddUnionOfServicesTo(
const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options,
- std::set<std::string>* unionOfServices) {
+ std::set<BluetoothUUID>* unionOfServices) {
for (const auto& filter : options->filters) {
- for (const std::string& uuid : filter->services) {
- unionOfServices->insert(uuid);
+ for (const std::unique_ptr<BluetoothUUID>& uuid : filter->services) {
Jeffrey Yasskin 2016/05/28 04:38:06 I'm definitely sad that there's no type-based way
ortuno 2016/05/31 17:30:47 I'm OK with waiting.
+ unionOfServices->insert(*uuid);
}
}
- for (const std::string& uuid : options->optional_services) {
- unionOfServices->insert(uuid);
+ for (const std::unique_ptr<BluetoothUUID>& uuid :
+ options->optional_services) {
+ unionOfServices->insert(*uuid);
}
}

Powered by Google App Engine
This is Rietveld 408576698