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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc

Issue 2481683002: bluetooth:android: Run error callback when characteristic is destroyed (Closed)
Patch Set: Fix TODO Created 4 years, 1 month 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 | « device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
index f532834f0b443040a63dc3c8eaf68f3bbb0d901b..3abe3bd2087053e9e3dd3881019ba10f225780cf 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
@@ -56,6 +56,18 @@ BluetoothRemoteGattCharacteristicWin::~BluetoothRemoteGattCharacteristicWin() {
}
parent_service_->GetWinAdapter()->NotifyGattCharacteristicRemoved(this);
+ if (!read_characteristic_value_callbacks_.first.is_null()) {
+ DCHECK(!read_characteristic_value_callbacks_.second.is_null());
+ read_characteristic_value_callbacks_.second.Run(
+ BluetoothRemoteGattService::GATT_ERROR_FAILED);
+ }
+
+ if (!write_characteristic_value_callbacks_.first.is_null()) {
+ DCHECK(!write_characteristic_value_callbacks_.second.is_null());
+ write_characteristic_value_callbacks_.second.Run(
+ BluetoothRemoteGattService::GATT_ERROR_FAILED);
+ }
+
// Clear pending StartNotifySession callbacks.
for (const auto& callback : start_notify_session_callbacks_)
callback.second.Run(BluetoothRemoteGattService::GATT_ERROR_FAILED);
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698