Chromium Code Reviews| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothError.h |
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothError.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothError.h |
| index c9374283b4cf3b0de64c4c7daa985b68ac74b147..9a66f4df7f240ea968e48f89bad2644c555b28e2 100644 |
| --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothError.h |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothError.h |
| @@ -11,8 +11,17 @@ |
| namespace blink { |
| +// These error codes requires detailed error messages. |
| +enum BluetoothErrorCode { |
|
dcheng
2017/02/28 05:09:51
enum class or nest it inside the BluetoothError cl
perja
2017/02/28 11:45:19
Done.
|
| + InvalidService, |
| + InvalidCharacteristic, |
| + InvalidDescriptor, |
| + ServiceNotFound, |
| + CharacteristicNotFound, |
| + DescriptorNotFound |
| +}; |
| + |
| class DOMException; |
| -class ScriptPromiseResolver; |
| // BluetoothError is used with CallbackPromiseAdapter to receive |
| // WebBluetoothResult responses. See CallbackPromiseAdapter class comments. |
| @@ -20,9 +29,11 @@ class BluetoothError { |
| STATIC_ONLY(BluetoothError); |
| public: |
| - // Interface required by CallbackPromiseAdapter: |
| - static DOMException* take(ScriptPromiseResolver*, |
| - mojom::blink::WebBluetoothResult); |
| + static DOMException* createDOMException(BluetoothErrorCode, |
| + const String& detailedMessage); |
| + |
| + static DOMException* createDOMException( |
| + mojom::blink::WebBluetoothResult error); |
| }; |
| } // namespace blink |