Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothError.h

Issue 2680783002: bluetooth: show better error messages for services, characteristics and descriptors (Closed)
Patch Set: Added comment and changed to enum class. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8e989506173e4a1c83b04068bf790a9a1e140bdb 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 class BluetoothErrorCode {
+ 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

Powered by Google App Engine
This is Rietveld 408576698