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

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

Issue 1666003002: bluetooth: Add Web Bluetooth blacklist checks to requestDevice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-blacklist-
Patch Set: fix test expectation with updated error string 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
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.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.cc
diff --git a/content/browser/bluetooth/bluetooth_allowed_devices_map.cc b/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
index e2c8ebc8ce6438dedd87fae2cd777ce95cc1f802..cd2e78929a3d2edab26522c518ac40ea406967fd 100644
--- a/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
+++ b/content/browser/bluetooth/bluetooth_allowed_devices_map.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
+#include "content/browser/bluetooth/bluetooth_blacklist.h"
#include "content/common/bluetooth/bluetooth_scan_filter.h"
#include "crypto/random.h"
#include "device/bluetooth/bluetooth_uuid.h"
@@ -140,6 +141,9 @@ 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)))
+ return false;
+
auto id_map_iter = origin_to_device_id_to_services_map_.find(origin);
if (id_map_iter == origin_to_device_id_to_services_map_.end()) {
return false;
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698