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 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/bluetooth/BluetoothError.h" | 6 #include "modules/bluetooth/BluetoothError.h" |
| 7 | 7 |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 MAP_ERROR(GATTNotPaired, NetworkError, "GATT Error: Not paired."); | 29 MAP_ERROR(GATTNotPaired, NetworkError, "GATT Error: Not paired."); |
| 30 MAP_ERROR(DeviceNoLongerInRange, NetworkError, "Bluetooth Device is no l onger in range."); | 30 MAP_ERROR(DeviceNoLongerInRange, NetworkError, "Bluetooth Device is no l onger in range."); |
| 31 MAP_ERROR(ConnectUnknownError, NetworkError, "Unknown error when connect ing to the device."); | 31 MAP_ERROR(ConnectUnknownError, NetworkError, "Unknown error when connect ing to the device."); |
| 32 MAP_ERROR(ConnectAlreadyInProgress, NetworkError, "Connection already in progress."); | 32 MAP_ERROR(ConnectAlreadyInProgress, NetworkError, "Connection already in progress."); |
| 33 MAP_ERROR(ConnectUnknownFailure, NetworkError, "Connection failed for un known reason."); | 33 MAP_ERROR(ConnectUnknownFailure, NetworkError, "Connection failed for un known reason."); |
| 34 MAP_ERROR(ConnectAuthFailed, NetworkError, "Authentication failed."); | 34 MAP_ERROR(ConnectAuthFailed, NetworkError, "Authentication failed."); |
| 35 MAP_ERROR(ConnectAuthCanceled, NetworkError, "Authentication canceled.") ; | 35 MAP_ERROR(ConnectAuthCanceled, NetworkError, "Authentication canceled.") ; |
| 36 MAP_ERROR(ConnectAuthRejected, NetworkError, "Authentication rejected.") ; | 36 MAP_ERROR(ConnectAuthRejected, NetworkError, "Authentication rejected.") ; |
| 37 MAP_ERROR(ConnectAuthTimeout, NetworkError, "Authentication timeout."); | 37 MAP_ERROR(ConnectAuthTimeout, NetworkError, "Authentication timeout."); |
| 38 MAP_ERROR(ConnectUnsupportedDevice, NetworkError, "Unsupported device.") ; | 38 MAP_ERROR(ConnectUnsupportedDevice, NetworkError, "Unsupported device.") ; |
| 39 MAP_ERROR(ConnectAttributeLengthInvalid, NetworkError, "Write operation exceeds the maximum length of the attribute."); | |
|
scheib
2015/11/26 00:02:51
Sort alphabetically all NetworkError items.
Kai Jiang
2015/11/29 10:40:52
Done.
| |
| 40 MAP_ERROR(ConnectConnectionCongested, NetworkError, "Remote device conne ction is congested."); | |
| 41 MAP_ERROR(ConnectInsufficientEncryption, NetworkError, "Insufficient enc ryption for a given operation"); | |
| 42 MAP_ERROR(ConnectOffsetInvalid, NetworkError, "Read or write operation w as requested with an invalid offset."); | |
| 43 MAP_ERROR(ConnectReadFailed, NetworkError, "GATT read operation is not p ermitted."); | |
|
scheib
2015/11/26 00:02:51
ConnectReadNotPermitted
Kai Jiang
2015/11/29 10:40:52
Done.
| |
| 44 MAP_ERROR(ConnectRequestNotSupported, NetworkError, "The given request i s not supported."); | |
| 45 MAP_ERROR(ConnectWriteFailed, NetworkError, "GATT write operation is not permitted."); | |
|
scheib
2015/11/26 00:02:51
ConnectWriteNotPermitted
Kai Jiang
2015/11/29 10:40:52
Done.
| |
| 39 MAP_ERROR(UntranslatedConnectErrorCode, NetworkError, "Unknown ConnectEr rorCode."); | 46 MAP_ERROR(UntranslatedConnectErrorCode, NetworkError, "Unknown ConnectEr rorCode."); |
| 40 | 47 |
| 41 // NotFoundErrors: | 48 // NotFoundErrors: |
| 42 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai lable."); | 49 MAP_ERROR(NoBluetoothAdapter, NotFoundError, "Bluetooth adapter not avai lable."); |
| 43 MAP_ERROR(ChosenDeviceVanished, NotFoundError, "User selected a device t hat doesn't exist anymore."); | 50 MAP_ERROR(ChosenDeviceVanished, NotFoundError, "User selected a device t hat doesn't exist anymore."); |
| 44 MAP_ERROR(ChooserCancelled, NotFoundError, "User cancelled the requestDe vice() chooser."); | 51 MAP_ERROR(ChooserCancelled, NotFoundError, "User cancelled the requestDe vice() chooser."); |
| 45 MAP_ERROR(ChooserDeniedPermission, NotFoundError, "User denied the brows er permission to scan for Bluetooth devices."); | 52 MAP_ERROR(ChooserDeniedPermission, NotFoundError, "User denied the brows er permission to scan for Bluetooth devices."); |
| 46 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device." ); | 53 MAP_ERROR(ServiceNotFound, NotFoundError, "Service not found in device." ); |
| 47 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou nd in device."); | 54 MAP_ERROR(CharacteristicNotFound, NotFoundError, "Characteristic not fou nd in device."); |
| 48 | 55 |
| 49 // NotSupportedErrors: | 56 // NotSupportedErrors: |
| 50 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); | 57 MAP_ERROR(GATTUnknownError, NotSupportedError, "GATT Error Unknown."); |
| 51 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed for unknown reason."); | 58 MAP_ERROR(GATTUnknownFailure, NotSupportedError, "GATT operation failed for unknown reason."); |
| 52 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi tted."); | 59 MAP_ERROR(GATTNotPermitted, NotSupportedError, "GATT operation not permi tted."); |
| 53 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte d."); | 60 MAP_ERROR(GATTNotSupported, NotSupportedError, "GATT Error: Not supporte d."); |
| 54 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk nown GattErrorCode."); | 61 MAP_ERROR(GATTUntranslatedErrorCode, NotSupportedError, "GATT Error: Unk nown GattErrorCode."); |
| 55 | 62 |
| 56 // SecurityErrors: | 63 // SecurityErrors: |
| 57 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz ed."); | 64 MAP_ERROR(GATTNotAuthorized, SecurityError, "GATT operation not authoriz ed."); |
| 58 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t he requestDevice() dialog."); | 65 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t he requestDevice() dialog."); |
| 59 | 66 |
| 60 #undef MAP_ERROR | 67 #undef MAP_ERROR |
| 61 } | 68 } |
| 62 | 69 |
| 63 ASSERT_NOT_REACHED(); | 70 ASSERT_NOT_REACHED(); |
| 64 return DOMException::create(UnknownError); | 71 return DOMException::create(UnknownError); |
| 65 } | 72 } |
| 66 | 73 |
| 67 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |