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 22ad2c63fd955f1db5bb3032a2cc1020f01c2ff4..f783d31e6a768667f3bb4e1c466d1b382e1ad99f 100644 |
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
@@ -866,6 +866,14 @@ void BluetoothDispatcherHost::OnReadValue( |
return; |
} |
+ if (BluetoothBlacklist::Get().IsExcludedFromReads( |
+ query_result.characteristic->GetUUID())) { |
+ RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome::BLACKLISTED); |
+ Send(new BluetoothMsg_ReadCharacteristicValueError( |
+ thread_id, request_id, WebBluetoothError::BlacklistedRead)); |
+ return; |
+ } |
+ |
query_result.characteristic->ReadRemoteCharacteristic( |
base::Bind(&BluetoothDispatcherHost::OnCharacteristicValueRead, |
weak_ptr_on_ui_thread_, thread_id, request_id), |
@@ -908,6 +916,14 @@ void BluetoothDispatcherHost::OnWriteValue( |
return; |
} |
+ if (BluetoothBlacklist::Get().IsExcludedFromWrites( |
+ query_result.characteristic->GetUUID())) { |
+ RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome::BLACKLISTED); |
+ Send(new BluetoothMsg_WriteCharacteristicValueError( |
+ thread_id, request_id, WebBluetoothError::BlacklistedWrite)); |
+ return; |
+ } |
+ |
query_result.characteristic->WriteRemoteCharacteristic( |
value, base::Bind(&BluetoothDispatcherHost::OnWriteValueSuccess, |
weak_ptr_on_ui_thread_, thread_id, request_id), |