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

Unified Diff: third_party/WebKit/Source/modules/webusb/USBError.cpp

Issue 1693433003: webusb: Reject the promise if the device is already open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/webusb/USBError.cpp
diff --git a/third_party/WebKit/Source/modules/webusb/USBError.cpp b/third_party/WebKit/Source/modules/webusb/USBError.cpp
index 7e203647f7dd654be41d09ec9f9ccba4d0cb0217..7fe34255bbd288c44cb646c2cafe4cd0eb248468 100644
--- a/third_party/WebKit/Source/modules/webusb/USBError.cpp
+++ b/third_party/WebKit/Source/modules/webusb/USBError.cpp
@@ -13,6 +13,8 @@ namespace blink {
DOMException* USBError::take(ScriptPromiseResolver*, const WebUSBError& webError)
{
switch (webError.error) {
+ case WebUSBError::Error::InvalidState:
+ return DOMException::create(InvalidStateError, webError.message);
case WebUSBError::Error::Network:
return DOMException::create(NetworkError, webError.message);
case WebUSBError::Error::NotFound:
« no previous file with comments | « device/usb/public/interfaces/device.mojom ('k') | third_party/WebKit/public/platform/modules/webusb/WebUSBError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698