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