| 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 // ID Not In Map Note: | 5 // ID Not In Map Note: |
| 6 // A service, characteristic, or descriptor ID not in the corresponding | 6 // A service, characteristic, or descriptor ID not in the corresponding |
| 7 // BluetoothDispatcherHost map [service_id_to_device_address_, | 7 // BluetoothDispatcherHost map [service_id_to_device_address_, |
| 8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a | 8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a |
| 9 // hostile renderer because a renderer obtains the corresponding ID from this | 9 // hostile renderer because a renderer obtains the corresponding ID from this |
| 10 // class and it will be added to the map at that time. | 10 // class and it will be added to the map at that time. |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 device::BluetoothAdapter* adapter, | 197 device::BluetoothAdapter* adapter, |
| 198 bool present) { | 198 bool present) { |
| 199 if (!present) { | 199 if (!present) { |
| 200 ClearState(); | 200 ClearState(); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter, | 204 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter, |
| 205 device::BluetoothDevice* device) { | 205 device::BluetoothDevice* device) { |
| 206 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 206 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 207 if (!device->IsGattConnected() || !device->IsConnected()) { | 207 if (!device->IsGattConnected()) { |
| 208 std::string device_id = | 208 std::string device_id = |
| 209 connected_devices_->CloseConnectionToDeviceWithAddress( | 209 connected_devices_->CloseConnectionToDeviceWithAddress( |
| 210 device->GetAddress()); | 210 device->GetAddress()); |
| 211 if (!device_id.empty()) { | 211 if (!device_id.empty()) { |
| 212 if (client_) { | 212 if (client_) { |
| 213 client_->GattServerDisconnected(device_id); | 213 client_->GattServerDisconnected(device_id); |
| 214 } | 214 } |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 } | 217 } |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 void WebBluetoothServiceImpl::ClearState() { | 829 void WebBluetoothServiceImpl::ClearState() { |
| 830 characteristic_id_to_notify_session_.clear(); | 830 characteristic_id_to_notify_session_.clear(); |
| 831 pending_primary_services_requests_.clear(); | 831 pending_primary_services_requests_.clear(); |
| 832 characteristic_id_to_service_id_.clear(); | 832 characteristic_id_to_service_id_.clear(); |
| 833 service_id_to_device_address_.clear(); | 833 service_id_to_device_address_.clear(); |
| 834 connected_devices_.reset( | 834 connected_devices_.reset( |
| 835 new FrameConnectedBluetoothDevices(render_frame_host_)); | 835 new FrameConnectedBluetoothDevices(render_frame_host_)); |
| 836 } | 836 } |
| 837 | 837 |
| 838 } // namespace content | 838 } // namespace content |
| OLD | NEW |