| 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 #ifndef WebBluetoothError_h | 5 #ifndef WebBluetoothError_h |
| 6 #define WebBluetoothError_h | 6 #define WebBluetoothError_h |
| 7 | 7 |
| 8 #include "public/platform/modules/bluetooth/web_bluetooth.mojom.h" |
| 9 |
| 8 namespace blink { | 10 namespace blink { |
| 9 | 11 |
| 10 // Errors that can occur during Web Bluetooth execution, which are transformed | 12 // Errors that can occur during Web Bluetooth execution, which are transformed |
| 11 // to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. | 13 // to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. |
| 12 // | 14 // |
| 13 // These errors all produce constant message strings. If a particular message | 15 // These errors all produce constant message strings. If a particular message |
| 14 // needs a dynamic component, we should add a separate enum so type-checking the
IPC | 16 // needs a dynamic component, we should add a separate enum so type-checking the
IPC |
| 15 // ensures the dynamic component is passed. | 17 // ensures the dynamic component is passed. |
| 16 enum class WebBluetoothError { | 18 using WebBluetoothError = mojom::WebBluetoothError; |
| 17 // AbortError: | |
| 18 // InvalidModificationError: | |
| 19 GATTInvalidAttributeLength, | |
| 20 // InvalidStateError: | |
| 21 ServiceNoLongerExists, | |
| 22 CharacteristicNoLongerExists, | |
| 23 // NetworkError: | |
| 24 ConnectAlreadyInProgress, | |
| 25 ConnectAttributeLengthInvalid, | |
| 26 ConnectAuthCanceled, | |
| 27 ConnectAuthFailed, | |
| 28 ConnectAuthRejected, | |
| 29 ConnectAuthTimeout, | |
| 30 ConnectConnectionCongested, | |
| 31 ConnectInsufficientEncryption, | |
| 32 ConnectOffsetInvalid, | |
| 33 ConnectReadNotPermitted, | |
| 34 ConnectRequestNotSupported, | |
| 35 ConnectUnknownError, | |
| 36 ConnectUnknownFailure, | |
| 37 ConnectUnsupportedDevice, | |
| 38 ConnectWriteNotPermitted, | |
| 39 DeviceNoLongerInRange, | |
| 40 GATTNotPaired, | |
| 41 GATTOperationInProgress, | |
| 42 UntranslatedConnectErrorCode, | |
| 43 // NotFoundError: | |
| 44 NoBluetoothAdapter, | |
| 45 ChosenDeviceVanished, | |
| 46 ChooserCancelled, | |
| 47 ChooserDisabled, | |
| 48 ChooserDeniedPermission, | |
| 49 ServiceNotFound, | |
| 50 CharacteristicNotFound, | |
| 51 NoCharacteristicsFound, | |
| 52 // NotSupportedError: | |
| 53 GATTUnknownError, | |
| 54 GATTUnknownFailure, | |
| 55 GATTNotPermitted, | |
| 56 GATTNotSupported, | |
| 57 GATTUntranslatedErrorCode, | |
| 58 // SecurityError: | |
| 59 GATTNotAuthorized, | |
| 60 BlacklistedCharacteristicUUID, | |
| 61 BlacklistedRead, | |
| 62 BlacklistedWrite, | |
| 63 NotAllowedToAccessService, | |
| 64 RequestDeviceWithBlacklistedUUID, | |
| 65 RequestDeviceWithUniqueOrigin, | |
| 66 RequestDeviceWithoutFrame, | |
| 67 // SyntaxError: | |
| 68 | |
| 69 ENUM_MAX_VALUE = RequestDeviceWithoutFrame, | |
| 70 }; | |
| 71 | |
| 72 } // namespace blink | 19 } // namespace blink |
| 73 | 20 |
| 74 #endif // WebBluetoothError_h | 21 #endif // WebBluetoothError_h |
| OLD | NEW |