| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_to_device_, characteristic_to_service_, | 7 // BluetoothDispatcherHost map [service_to_device_, characteristic_to_service_, |
| 8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer | 8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer |
| 9 // obtains the corresponding ID from this class and it will be added to the map | 9 // obtains the corresponding ID from this class and it will be added to the map |
| 10 // at that time. | 10 // at that time. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return WebBluetoothError::ConnectAuthCanceled; | 131 return WebBluetoothError::ConnectAuthCanceled; |
| 132 case device::BluetoothDevice::ERROR_AUTH_REJECTED: | 132 case device::BluetoothDevice::ERROR_AUTH_REJECTED: |
| 133 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_REJECTED); | 133 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_REJECTED); |
| 134 return WebBluetoothError::ConnectAuthRejected; | 134 return WebBluetoothError::ConnectAuthRejected; |
| 135 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT: | 135 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT: |
| 136 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_TIMEOUT); | 136 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_TIMEOUT); |
| 137 return WebBluetoothError::ConnectAuthTimeout; | 137 return WebBluetoothError::ConnectAuthTimeout; |
| 138 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: | 138 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: |
| 139 RecordConnectGATTOutcome(UMAConnectGATTOutcome::UNSUPPORTED_DEVICE); | 139 RecordConnectGATTOutcome(UMAConnectGATTOutcome::UNSUPPORTED_DEVICE); |
| 140 return WebBluetoothError::ConnectUnsupportedDevice; | 140 return WebBluetoothError::ConnectUnsupportedDevice; |
| 141 case device::BluetoothDevice::ERROR_ATTRIBUTE_LENGTH_INVALID: |
| 142 RecordConnectGATTOutcome(UMAConnectGATTOutcome::ATTRIBUTE_LENGTH_INVALID); |
| 143 return WebBluetoothError::ConnectAttributeLengthInvalid; |
| 144 case device::BluetoothDevice::ERROR_CONNECTION_CONGESTED: |
| 145 RecordConnectGATTOutcome(UMAConnectGATTOutcome::CONNECTION_CONGESTED); |
| 146 return WebBluetoothError::ConnectConnectionCongested; |
| 147 case device::BluetoothDevice::ERROR_INSUFFICIENT_ENCRYPTION: |
| 148 RecordConnectGATTOutcome(UMAConnectGATTOutcome::INSUFFICIENT_ENCRYPTION); |
| 149 return WebBluetoothError::ConnectInsufficientEncryption; |
| 150 case device::BluetoothDevice::ERROR_OFFSET_INVALID: |
| 151 RecordConnectGATTOutcome(UMAConnectGATTOutcome::OFFSET_INVALID); |
| 152 return WebBluetoothError::ConnectOffsetInvalid; |
| 153 case device::BluetoothDevice::ERROR_READ_NOT_PERMITTED: |
| 154 RecordConnectGATTOutcome(UMAConnectGATTOutcome::READ_NOT_PERMITTED); |
| 155 return WebBluetoothError::ConnectReadNotPermitted; |
| 156 case device::BluetoothDevice::ERROR_REQUEST_NOT_SUPPORTED: |
| 157 RecordConnectGATTOutcome(UMAConnectGATTOutcome::REQUEST_NOT_SUPPORTED); |
| 158 return WebBluetoothError::ConnectRequestNotSupported; |
| 159 case device::BluetoothDevice::ERROR_WRITE_NOT_PERMITTED: |
| 160 RecordConnectGATTOutcome(UMAConnectGATTOutcome::WRITE_NOT_PERMITTED); |
| 161 return WebBluetoothError::ConnectWriteNotPermitted; |
| 162 case device::BluetoothDevice::NUM_CONNECT_ERROR_CODES: |
| 163 NOTREACHED(); |
| 164 return WebBluetoothError::UntranslatedConnectErrorCode; |
| 141 } | 165 } |
| 142 NOTREACHED(); | 166 NOTREACHED(); |
| 143 return WebBluetoothError::UntranslatedConnectErrorCode; | 167 return WebBluetoothError::UntranslatedConnectErrorCode; |
| 144 } | 168 } |
| 145 | 169 |
| 146 blink::WebBluetoothError TranslateGATTError( | 170 blink::WebBluetoothError TranslateGATTError( |
| 147 BluetoothGattService::GattErrorCode error_code, | 171 BluetoothGattService::GattErrorCode error_code, |
| 148 UMAGATTOperation operation) { | 172 UMAGATTOperation operation) { |
| 149 switch (error_code) { | 173 switch (error_code) { |
| 150 case BluetoothGattService::GATT_ERROR_UNKNOWN: | 174 case BluetoothGattService::GATT_ERROR_UNKNOWN: |
| (...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1370 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1347 NOTIMPLEMENTED(); | 1371 NOTIMPLEMENTED(); |
| 1348 } | 1372 } |
| 1349 | 1373 |
| 1350 void BluetoothDispatcherHost::ShowNeedLocationLink() { | 1374 void BluetoothDispatcherHost::ShowNeedLocationLink() { |
| 1351 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1375 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1352 NOTIMPLEMENTED(); | 1376 NOTIMPLEMENTED(); |
| 1353 } | 1377 } |
| 1354 | 1378 |
| 1355 } // namespace content | 1379 } // namespace content |
| OLD | NEW |