Chromium Code Reviews| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 return WebBluetoothError::ConnectAuthCanceled; | 127 return WebBluetoothError::ConnectAuthCanceled; |
| 128 case device::BluetoothDevice::ERROR_AUTH_REJECTED: | 128 case device::BluetoothDevice::ERROR_AUTH_REJECTED: |
| 129 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_REJECTED); | 129 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_REJECTED); |
| 130 return WebBluetoothError::ConnectAuthRejected; | 130 return WebBluetoothError::ConnectAuthRejected; |
| 131 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT: | 131 case device::BluetoothDevice::ERROR_AUTH_TIMEOUT: |
| 132 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_TIMEOUT); | 132 RecordConnectGATTOutcome(UMAConnectGATTOutcome::AUTH_TIMEOUT); |
| 133 return WebBluetoothError::ConnectAuthTimeout; | 133 return WebBluetoothError::ConnectAuthTimeout; |
| 134 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: | 134 case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: |
| 135 RecordConnectGATTOutcome(UMAConnectGATTOutcome::UNSUPPORTED_DEVICE); | 135 RecordConnectGATTOutcome(UMAConnectGATTOutcome::UNSUPPORTED_DEVICE); |
| 136 return WebBluetoothError::ConnectUnsupportedDevice; | 136 return WebBluetoothError::ConnectUnsupportedDevice; |
| 137 case device::BluetoothDevice::ERROR_ATTRIBUTE_LENGTH_INVALID: | |
|
scheib
2015/11/26 00:02:51
Sort list.
| |
| 138 RecordConnectGATTOutcome(UMAConnectGATTOutcome::ATTRIBUTE_LENGTH_INVALID); | |
| 139 return WebBluetoothError::ConnectAttributeLengthInvalid; | |
| 140 case device::BluetoothDevice::ERROR_CONNECTION_CONGESTED: | |
| 141 RecordConnectGATTOutcome(UMAConnectGATTOutcome::CONNECTION_CONGESTED); | |
| 142 return WebBluetoothError::ConnectConnectionCongested; | |
| 143 case device::BluetoothDevice::ERROR_INSUFFICIENT_ENCRYPTION: | |
| 144 RecordConnectGATTOutcome(UMAConnectGATTOutcome::INSUFFICIENT_ENCRYPTION); | |
| 145 return WebBluetoothError::ConnectInsufficientEncryption; | |
| 146 case device::BluetoothDevice::ERROR_OFFSET_INVALID: | |
| 147 RecordConnectGATTOutcome(UMAConnectGATTOutcome::OFFSET_INVALID); | |
| 148 return WebBluetoothError::ConnectOffsetInvalid; | |
| 149 case device::BluetoothDevice::ERROR_READ_FAILED: | |
| 150 RecordConnectGATTOutcome(UMAConnectGATTOutcome::READ_FAILED); | |
| 151 return WebBluetoothError::ConnectReadFailed; | |
| 152 case device::BluetoothDevice::ERROR_REQUEST_NOT_SUPPORTED: | |
| 153 RecordConnectGATTOutcome(UMAConnectGATTOutcome::REQUEST_NOT_SUPPORTED); | |
| 154 return WebBluetoothError::ConnectRequestNotSupported; | |
| 155 case device::BluetoothDevice::ERROR_WRITE_FAILED: | |
| 156 RecordConnectGATTOutcome(UMAConnectGATTOutcome::WRITE_FAILED); | |
| 157 return WebBluetoothError::ConnectWriteFailed; | |
| 137 } | 158 } |
| 138 NOTREACHED(); | 159 NOTREACHED(); |
| 139 return WebBluetoothError::UntranslatedConnectErrorCode; | 160 return WebBluetoothError::UntranslatedConnectErrorCode; |
| 140 } | 161 } |
| 141 | 162 |
| 142 blink::WebBluetoothError TranslateGATTError( | 163 blink::WebBluetoothError TranslateGATTError( |
| 143 BluetoothGattService::GattErrorCode error_code, | 164 BluetoothGattService::GattErrorCode error_code, |
| 144 UMAGATTOperation operation) { | 165 UMAGATTOperation operation) { |
| 145 switch (error_code) { | 166 switch (error_code) { |
| 146 case BluetoothGattService::GATT_ERROR_UNKNOWN: | 167 case BluetoothGattService::GATT_ERROR_UNKNOWN: |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1340 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1361 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1341 NOTIMPLEMENTED(); | 1362 NOTIMPLEMENTED(); |
| 1342 } | 1363 } |
| 1343 | 1364 |
| 1344 void BluetoothDispatcherHost::ShowNeedLocationLink() { | 1365 void BluetoothDispatcherHost::ShowNeedLocationLink() { |
| 1345 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1366 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1346 NOTIMPLEMENTED(); | 1367 NOTIMPLEMENTED(); |
| 1347 } | 1368 } |
| 1348 | 1369 |
| 1349 } // namespace content | 1370 } // namespace content |
| OLD | NEW |