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

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

Issue 1699673002: bluetooth: Require valid UUIDs when testing against Web Bluetooth Blacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-blacklist-integration-
Patch Set: added check when adding uuid. Created 4 years, 10 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_blacklist.cc
diff --git a/content/browser/bluetooth/bluetooth_blacklist.cc b/content/browser/bluetooth/bluetooth_blacklist.cc
index db717db320bceab1c316fa084356f6db56d4c229..94891db06da37000a3116ebe0e34ac19b01a1f9e 100644
--- a/content/browser/bluetooth/bluetooth_blacklist.cc
+++ b/content/browser/bluetooth/bluetooth_blacklist.cc
@@ -27,11 +27,13 @@ BluetoothBlacklist& BluetoothBlacklist::Get() {
void BluetoothBlacklist::AddOrDie(const device::BluetoothUUID& uuid,
Value value) {
+ CHECK(uuid.IsValid());
auto insert_result = blacklisted_uuids_.insert(std::make_pair(uuid, value));
CHECK(insert_result.second);
}
bool BluetoothBlacklist::IsExcluded(const BluetoothUUID& uuid) const {
+ CHECK(uuid.IsValid());
const auto& it = blacklisted_uuids_.find(uuid);
if (it == blacklisted_uuids_.end())
return false;
@@ -51,6 +53,7 @@ bool BluetoothBlacklist::IsExcluded(
}
bool BluetoothBlacklist::IsExcludedFromReads(const BluetoothUUID& uuid) const {
+ CHECK(uuid.IsValid());
const auto& it = blacklisted_uuids_.find(uuid);
if (it == blacklisted_uuids_.end())
return false;
@@ -58,6 +61,7 @@ bool BluetoothBlacklist::IsExcludedFromReads(const BluetoothUUID& uuid) const {
}
bool BluetoothBlacklist::IsExcludedFromWrites(const BluetoothUUID& uuid) const {
+ CHECK(uuid.IsValid());
const auto& it = blacklisted_uuids_.find(uuid);
if (it == blacklisted_uuids_.end())
return false;
« no previous file with comments | « content/browser/bluetooth/bluetooth_blacklist.h ('k') | content/browser/bluetooth/bluetooth_blacklist_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698