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 311677d96a9fef7cf2ac76630f024f4a1c811cea..01f9d8478baf67e9a62d5a2633bf1715b2455032 100644 |
| --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothError.h |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothError.h |
| @@ -6,6 +6,7 @@ |
| #define BluetoothError_h |
| #include "platform/heap/Handle.h" |
| +#include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" |
|
haraken
2017/02/07 15:22:52
Nit: "third_party/WebKit" is not needed.
|
| #include "wtf/Allocator.h" |
| namespace blink { |
| @@ -26,6 +27,17 @@ class BluetoothError { |
| ScriptPromiseResolver*, |
| int32_t |
| error /* Corresponds to WebBluetoothResult in web_bluetooth.mojom */); |
| + static DOMException* take( |
| + ScriptPromiseResolver*, |
| + int32_t |
| + error /* Corresponds to WebBluetoothResult in web_bluetooth.mojom */, |
| + String detailedMessage /* Detailed error message - can be empty.*/); |
| + |
| + // A convenience function that checks if the int32_t error code is |
| + // the same as the given WebBluetoothResult error. Parts of the code |
| + // uses int32_t for errors while other parts uses WebBluetoothResult. |
| + static bool isSameError(int32_t error, |
| + mojom::blink::WebBluetoothResult webError); |
|
haraken
2017/02/07 15:22:52
Can we use a type mapping for this? (I don't know
|
| }; |
| } // namespace blink |