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

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

Issue 1521803002: Match WebUSB errors more closely to the specificiation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 cea84dfce5d2603844a9d2fded162cbf7deaf837..6bd48cb6f52b26fcd2557592369e4f45da0fc9ab 100644
--- a/third_party/WebKit/Source/modules/webusb/USBError.cpp
+++ b/third_party/WebKit/Source/modules/webusb/USBError.cpp
@@ -14,12 +14,12 @@ namespace blink {
DOMException* USBError::take(ScriptPromiseResolver*, const WebUSBError& webError)
{
switch (webError.error) {
- case WebUSBError::Error::Device:
+ case WebUSBError::Error::Network:
+ return DOMException::create(NetworkError, webError.message);
+ case WebUSBError::Error::NotFound:
+ return DOMException::create(NotFoundError, webError.message);
case WebUSBError::Error::Security:
- case WebUSBError::Error::Service:
- case WebUSBError::Error::Transfer:
- // TODO(rockot): Differentiate between different error types.
- return DOMException::create(AbortError, webError.message);
+ return DOMException::create(SecurityError, webError.message);
}
ASSERT_NOT_REACHED();
return DOMException::create(UnknownError);
« no previous file with comments | « content/renderer/usb/web_usb_device_impl.cc ('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