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 BluetoothError_h | 5 #ifndef BluetoothError_h |
6 #define BluetoothError_h | 6 #define BluetoothError_h |
7 | 7 |
8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
9 #include "platform/wtf/Allocator.h" | 9 #include "platform/wtf/Allocator.h" |
10 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" | 10 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 // Used when generating DOMExceptions specific to each operation. | 14 // Used when generating DOMExceptions specific to each operation. |
15 // TODO(crbug.com/684445): Add DescriptorsRetrieval. | |
16 enum class BluetoothOperation { | 15 enum class BluetoothOperation { |
17 kServicesRetrieval, | 16 kServicesRetrieval, |
18 kCharacteristicsRetrieval, | 17 kCharacteristicsRetrieval, |
19 kDescriptorsRetrieval, | 18 kDescriptorsRetrieval, |
20 GATT, | 19 kGATT, |
21 }; | 20 }; |
22 | 21 |
23 // These error codes requires detailed error messages. | 22 // These error codes requires detailed error messages. |
24 enum class BluetoothErrorCode { | 23 enum class BluetoothErrorCode { |
25 kInvalidService, | 24 kInvalidService, |
26 kInvalidCharacteristic, | 25 kInvalidCharacteristic, |
27 kInvalidDescriptor, | 26 kInvalidDescriptor, |
28 kServiceNotFound, | 27 kServiceNotFound, |
29 kCharacteristicNotFound, | 28 kCharacteristicNotFound, |
30 kDescriptorNotFound | 29 kDescriptorNotFound |
(...skipping 11 matching lines...) Expand all Loading... |
42 static DOMException* CreateDOMException(BluetoothErrorCode, | 41 static DOMException* CreateDOMException(BluetoothErrorCode, |
43 const String& detailed_message); | 42 const String& detailed_message); |
44 | 43 |
45 static DOMException* CreateDOMException( | 44 static DOMException* CreateDOMException( |
46 mojom::blink::WebBluetoothResult error); | 45 mojom::blink::WebBluetoothResult error); |
47 }; | 46 }; |
48 | 47 |
49 } // namespace blink | 48 } // namespace blink |
50 | 49 |
51 #endif // BluetoothError_h | 50 #endif // BluetoothError_h |
OLD | NEW |