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 "modules/bluetooth/BluetoothError.h" | 5 #include "modules/bluetooth/BluetoothError.h" |
6 | 6 |
7 #include "core/dom/DOMException.h" | 7 #include "core/dom/DOMException.h" |
8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 CHOOSER_NOT_SHOWN_USER_DENIED_PERMISSION_TO_SCAN, NotFoundError, | 85 CHOOSER_NOT_SHOWN_USER_DENIED_PERMISSION_TO_SCAN, NotFoundError, |
86 "User denied the browser permission to scan for Bluetooth devices."); | 86 "User denied the browser permission to scan for Bluetooth devices."); |
87 MAP_ERROR(SERVICE_NOT_FOUND, NotFoundError, | 87 MAP_ERROR(SERVICE_NOT_FOUND, NotFoundError, |
88 "No Services with specified UUID found in Device."); | 88 "No Services with specified UUID found in Device."); |
89 MAP_ERROR(NO_SERVICES_FOUND, NotFoundError, | 89 MAP_ERROR(NO_SERVICES_FOUND, NotFoundError, |
90 "No Services found in device."); | 90 "No Services found in device."); |
91 MAP_ERROR(CHARACTERISTIC_NOT_FOUND, NotFoundError, | 91 MAP_ERROR(CHARACTERISTIC_NOT_FOUND, NotFoundError, |
92 "No Characteristics with specified UUID found in Service."); | 92 "No Characteristics with specified UUID found in Service."); |
93 MAP_ERROR(NO_CHARACTERISTICS_FOUND, NotFoundError, | 93 MAP_ERROR(NO_CHARACTERISTICS_FOUND, NotFoundError, |
94 "No Characteristics found in service."); | 94 "No Characteristics found in service."); |
| 95 MAP_ERROR(DESCRIPTOR_NOT_FOUND, NotFoundError, |
| 96 "No Descriptors with specified UUID found in Characteristic."); |
| 97 MAP_ERROR(NO_DESCRIPTORS_FOUND, NotFoundError, |
| 98 "No Descriptors found in Characteristic."); |
95 MAP_ERROR(BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, NotFoundError, | 99 MAP_ERROR(BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, NotFoundError, |
96 "Bluetooth Low Energy not available."); | 100 "Bluetooth Low Energy not available."); |
97 | 101 |
98 // NotSupportedErrors: | 102 // NotSupportedErrors: |
99 MAP_ERROR(GATT_UNKNOWN_ERROR, NotSupportedError, "GATT Error Unknown."); | 103 MAP_ERROR(GATT_UNKNOWN_ERROR, NotSupportedError, "GATT Error Unknown."); |
100 MAP_ERROR(GATT_UNKNOWN_FAILURE, NotSupportedError, | 104 MAP_ERROR(GATT_UNKNOWN_FAILURE, NotSupportedError, |
101 "GATT operation failed for unknown reason."); | 105 "GATT operation failed for unknown reason."); |
102 MAP_ERROR(GATT_NOT_PERMITTED, NotSupportedError, | 106 MAP_ERROR(GATT_NOT_PERMITTED, NotSupportedError, |
103 "GATT operation not permitted."); | 107 "GATT operation not permitted."); |
104 MAP_ERROR(GATT_NOT_SUPPORTED, NotSupportedError, | 108 MAP_ERROR(GATT_NOT_SUPPORTED, NotSupportedError, |
105 "GATT Error: Not supported."); | 109 "GATT Error: Not supported."); |
106 MAP_ERROR(GATT_UNTRANSLATED_ERROR_CODE, NotSupportedError, | 110 MAP_ERROR(GATT_UNTRANSLATED_ERROR_CODE, NotSupportedError, |
107 "GATT Error: Unknown GattErrorCode."); | 111 "GATT Error: Unknown GattErrorCode."); |
108 | 112 |
109 // SecurityErrors: | 113 // SecurityErrors: |
110 MAP_ERROR(GATT_NOT_AUTHORIZED, SecurityError, | 114 MAP_ERROR(GATT_NOT_AUTHORIZED, SecurityError, |
111 "GATT operation not authorized."); | 115 "GATT operation not authorized."); |
112 MAP_ERROR(BLOCKLISTED_CHARACTERISTIC_UUID, SecurityError, | 116 MAP_ERROR(BLOCKLISTED_CHARACTERISTIC_UUID, SecurityError, |
113 "getCharacteristic(s) called with blocklisted UUID. " | 117 "getCharacteristic(s) called with blocklisted UUID. " |
114 "https://goo.gl/4NeimX"); | 118 "https://goo.gl/4NeimX"); |
| 119 MAP_ERROR(BLOCKLISTED_DESCRIPTOR_UUID, SecurityError, |
| 120 "getDescriptor(s) called with blocklisted UUID. " |
| 121 "https://goo.gl/4NeimX"); |
115 MAP_ERROR(BLOCKLISTED_READ, SecurityError, | 122 MAP_ERROR(BLOCKLISTED_READ, SecurityError, |
116 "readValue() called on blocklisted object marked " | 123 "readValue() called on blocklisted object marked " |
117 "exclude-reads. https://goo.gl/4NeimX"); | 124 "exclude-reads. https://goo.gl/4NeimX"); |
118 MAP_ERROR(BLOCKLISTED_WRITE, SecurityError, | 125 MAP_ERROR(BLOCKLISTED_WRITE, SecurityError, |
119 "writeValue() called on blocklisted object marked " | 126 "writeValue() called on blocklisted object marked " |
120 "exclude-writes. https://goo.gl/4NeimX"); | 127 "exclude-writes. https://goo.gl/4NeimX"); |
121 MAP_ERROR(NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, SecurityError, | 128 MAP_ERROR(NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, SecurityError, |
122 "Origin is not allowed to access any service. Tip: Add the " | 129 "Origin is not allowed to access any service. Tip: Add the " |
123 "service UUID to 'optionalServices' in requestDevice() " | 130 "service UUID to 'optionalServices' in requestDevice() " |
124 "options. https://goo.gl/HxfxSQ"); | 131 "options. https://goo.gl/HxfxSQ"); |
(...skipping 10 matching lines...) Expand all Loading... |
135 "No window to show the requestDevice() dialog."); | 142 "No window to show the requestDevice() dialog."); |
136 | 143 |
137 #undef MAP_ERROR | 144 #undef MAP_ERROR |
138 } | 145 } |
139 | 146 |
140 ASSERT_NOT_REACHED(); | 147 ASSERT_NOT_REACHED(); |
141 return DOMException::create(UnknownError); | 148 return DOMException::create(UnknownError); |
142 } | 149 } |
143 | 150 |
144 } // namespace blink | 151 } // namespace blink |
OLD | NEW |