Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_device_win.h" | 5 #include "device/bluetooth/bluetooth_device_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/containers/scoped_ptr_hash_map.h" | 9 #include "base/containers/scoped_ptr_hash_map.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 const net::NetLog::Source& net_log_source) | 36 const net::NetLog::Source& net_log_source) |
| 37 : BluetoothDevice(adapter), | 37 : BluetoothDevice(adapter), |
| 38 ui_task_runner_(ui_task_runner), | 38 ui_task_runner_(ui_task_runner), |
| 39 socket_thread_(socket_thread), | 39 socket_thread_(socket_thread), |
| 40 net_log_(net_log), | 40 net_log_(net_log), |
| 41 net_log_source_(net_log_source) { | 41 net_log_source_(net_log_source) { |
| 42 Update(device_state); | 42 Update(device_state); |
| 43 } | 43 } |
| 44 | 44 |
| 45 BluetoothDeviceWin::~BluetoothDeviceWin() { | 45 BluetoothDeviceWin::~BluetoothDeviceWin() { |
| 46 // Explicitly take and erase GATT services one by one to ensure that calling | |
|
ortuno
2016/03/30 22:34:23
This seems unrelated to this change. Why are you d
gogerald1
2016/03/31 17:44:12
This is a related change, otherwise GetGattService
ortuno
2016/03/31 18:09:19
It still seems a bug not related to the feature yo
gogerald1
2016/04/04 23:34:00
Acknowledged.
| |
| 47 // GetGattService on removed service in GattServiceRemoved return null. | |
|
ortuno
2016/03/30 22:34:23
s/return/returns/
gogerald1
2016/03/31 17:44:12
Done.
| |
| 48 std::vector<std::string> service_keys; | |
| 49 for (const auto& gatt_service : gatt_services_) { | |
| 50 service_keys.push_back(gatt_service.first); | |
| 51 } | |
| 52 for (const auto& key : service_keys) { | |
| 53 gatt_services_.take_and_erase(key); | |
| 54 } | |
| 46 } | 55 } |
| 47 | 56 |
| 48 uint32_t BluetoothDeviceWin::GetBluetoothClass() const { | 57 uint32_t BluetoothDeviceWin::GetBluetoothClass() const { |
| 49 return bluetooth_class_; | 58 return bluetooth_class_; |
| 50 } | 59 } |
| 51 | 60 |
| 52 std::string BluetoothDeviceWin::GetAddress() const { | 61 std::string BluetoothDeviceWin::GetAddress() const { |
| 53 return address_; | 62 return address_; |
| 54 } | 63 } |
| 55 | 64 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 gatt_services_.add(primary_service->GetIdentifier(), | 391 gatt_services_.add(primary_service->GetIdentifier(), |
| 383 scoped_ptr<BluetoothGattService>(primary_service)); | 392 scoped_ptr<BluetoothGattService>(primary_service)); |
| 384 adapter_->NotifyGattServiceAdded(primary_service); | 393 adapter_->NotifyGattServiceAdded(primary_service); |
| 385 } | 394 } |
| 386 } | 395 } |
| 387 | 396 |
| 388 adapter_->NotifyGattServicesDiscovered(this); | 397 adapter_->NotifyGattServicesDiscovered(this); |
| 389 } | 398 } |
| 390 | 399 |
| 391 } // namespace device | 400 } // namespace device |
| OLD | NEW |