| 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: A service, characteristic, or descriptor ID not in the | 5 // ID Not In Map Note: A service, characteristic, or descriptor ID not in the |
| 6 // corresponding WebBluetoothServiceImpl map [service_id_to_device_address_, | 6 // corresponding WebBluetoothServiceImpl map [service_id_to_device_address_, |
| 7 // characteristic_id_to_service_id_, descriptor_id_to_characteristic_id_] | 7 // characteristic_id_to_service_id_, descriptor_id_to_characteristic_id_] |
| 8 // implies a hostile renderer because a renderer obtains the corresponding ID | 8 // implies a hostile renderer because a renderer obtains the corresponding ID |
| 9 // from this class and it will be added to the map at that time. | 9 // from this class and it will be added to the map at that time. |
| 10 | 10 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 value); | 288 value); |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 void WebBluetoothServiceImpl::RequestDevice( | 292 void WebBluetoothServiceImpl::RequestDevice( |
| 293 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, | 293 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, |
| 294 const RequestDeviceCallback& callback) { | 294 const RequestDeviceCallback& callback) { |
| 295 RecordRequestDeviceOptions(options); | 295 RecordRequestDeviceOptions(options); |
| 296 | 296 |
| 297 if (!GetAdapter()) { | 297 if (!GetAdapter()) { |
| 298 if (BluetoothAdapterFactoryWrapper::Get().IsLowEnergyAvailable()) { | 298 if (BluetoothAdapterFactoryWrapper::Get().IsLowEnergySupported()) { |
| 299 BluetoothAdapterFactoryWrapper::Get().AcquireAdapter( | 299 BluetoothAdapterFactoryWrapper::Get().AcquireAdapter( |
| 300 this, base::Bind(&WebBluetoothServiceImpl::RequestDeviceImpl, | 300 this, base::Bind(&WebBluetoothServiceImpl::RequestDeviceImpl, |
| 301 weak_ptr_factory_.GetWeakPtr(), | 301 weak_ptr_factory_.GetWeakPtr(), |
| 302 base::Passed(std::move(options)), callback)); | 302 base::Passed(std::move(options)), callback)); |
| 303 return; | 303 return; |
| 304 } | 304 } |
| 305 RecordRequestDeviceOutcome( | 305 RecordRequestDeviceOutcome( |
| 306 UMARequestDeviceOutcome::BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE); | 306 UMARequestDeviceOutcome::BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE); |
| 307 callback.Run( | 307 callback.Run( |
| 308 blink::mojom::WebBluetoothResult::BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, | 308 blink::mojom::WebBluetoothResult::BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 descriptor_id_to_characteristic_id_.clear(); | 1185 descriptor_id_to_characteristic_id_.clear(); |
| 1186 characteristic_id_to_service_id_.clear(); | 1186 characteristic_id_to_service_id_.clear(); |
| 1187 service_id_to_device_address_.clear(); | 1187 service_id_to_device_address_.clear(); |
| 1188 connected_devices_.reset( | 1188 connected_devices_.reset( |
| 1189 new FrameConnectedBluetoothDevices(render_frame_host_)); | 1189 new FrameConnectedBluetoothDevices(render_frame_host_)); |
| 1190 device_chooser_controller_.reset(); | 1190 device_chooser_controller_.reset(); |
| 1191 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this); | 1191 BluetoothAdapterFactoryWrapper::Get().ReleaseAdapter(this); |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 } // namespace content | 1194 } // namespace content |
| OLD | NEW |