OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/bluetooth_remote_gatt_service_win.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_service_win.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "device/bluetooth/bluetooth_adapter_win.h" | 8 #include "device/bluetooth/bluetooth_adapter_win.h" |
9 #include "device/bluetooth/bluetooth_device_win.h" | 9 #include "device/bluetooth/bluetooth_device_win.h" |
10 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_win.h" | 10 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_win.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 243 } |
244 | 244 |
245 void BluetoothRemoteGattServiceWin::RemoveIncludedCharacteristic( | 245 void BluetoothRemoteGattServiceWin::RemoveIncludedCharacteristic( |
246 std::string identifier) { | 246 std::string identifier) { |
247 discovery_completed_included_charateristics_.erase(identifier); | 247 discovery_completed_included_charateristics_.erase(identifier); |
248 included_characteristics_.erase(identifier); | 248 included_characteristics_.erase(identifier); |
249 } | 249 } |
250 | 250 |
251 void BluetoothRemoteGattServiceWin::ClearIncludedCharacteristics() { | 251 void BluetoothRemoteGattServiceWin::ClearIncludedCharacteristics() { |
252 discovery_completed_included_charateristics_.clear(); | 252 discovery_completed_included_charateristics_.clear(); |
| 253 // Explicitly reset to null to ensure that calling GetCharacteristic() on the |
| 254 // removed characteristic in GattDescriptorRemoved() returns null. |
| 255 for (auto& entry : included_characteristics_) |
| 256 entry.second.reset(); |
253 included_characteristics_.clear(); | 257 included_characteristics_.clear(); |
254 } | 258 } |
255 | 259 |
256 } // namespace device. | 260 } // namespace device. |
OLD | NEW |