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

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

Issue 1697873002: bluetooth: Test Web Bluetooth getCharacteristic calls against blacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-blacklist-integration-
Patch Set: move glucose UUID in code as well 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_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
index 81ba1896929f39605fd05f3a0d9497c73e0873ef..22ad2c63fd955f1db5bb3032a2cc1020f01c2ff4 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -792,6 +792,16 @@ void BluetoothDispatcherHost::OnGetCharacteristic(
RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction::GET_CHARACTERISTIC);
RecordGetCharacteristicCharacteristic(characteristic_uuid);
+ // Check Blacklist for characteristic_uuid.
+ if (BluetoothBlacklist::Get().IsExcluded(
+ BluetoothUUID(characteristic_uuid))) {
+ RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::BLACKLISTED);
+ Send(new BluetoothMsg_GetCharacteristicError(
+ thread_id, request_id,
+ WebBluetoothError::BlacklistedCharacteristicUUID));
+ return;
+ }
+
const CacheQueryResult query_result =
QueryCacheForService(GetOrigin(frame_routing_id), service_instance_id);
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698