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

Unified Diff: device/bluetooth/bluetooth_device_win.cc

Issue 1749403002: Implement BluetoothRemoteGattCharacteristicWin::StartNotifySession and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move comments Created 4 years, 8 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 | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_gatt_characteristic_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device_win.cc
diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc
index 561b5a7c6532bb92298f355d70b32c07ca0dec53..363da1d1e02f5a9850e66eadbdcf55f189210146 100644
--- a/device/bluetooth/bluetooth_device_win.cc
+++ b/device/bluetooth/bluetooth_device_win.cc
@@ -43,6 +43,15 @@ BluetoothDeviceWin::BluetoothDeviceWin(
}
BluetoothDeviceWin::~BluetoothDeviceWin() {
+ // Explicitly take and erase GATT services one by one to ensure that calling
+ // GetGattService on removed service in GattServiceRemoved returns null.
+ std::vector<std::string> service_keys;
+ for (const auto& gatt_service : gatt_services_) {
+ service_keys.push_back(gatt_service.first);
+ }
+ for (const auto& key : service_keys) {
+ gatt_services_.take_and_erase(key);
+ }
}
uint32_t BluetoothDeviceWin::GetBluetoothClass() const {
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_gatt_characteristic_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698