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

Unified Diff: content/renderer/usb/web_usb_client_impl.cc

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
« no previous file with comments | « no previous file | content/renderer/usb/web_usb_device_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/usb/web_usb_client_impl.cc
diff --git a/content/renderer/usb/web_usb_client_impl.cc b/content/renderer/usb/web_usb_client_impl.cc
index 33d7f37fde8eff367d42f55d908bff3d8b639b4f..076084872864816a92d5b30e1ebe853d6135c77d 100644
--- a/content/renderer/usb/web_usb_client_impl.cc
+++ b/content/renderer/usb/web_usb_client_impl.cc
@@ -46,8 +46,8 @@ ScopedWebCallbacks<CallbacksType> MakeScopedUSBCallbacks(
return make_scoped_web_callbacks(
callbacks,
base::Bind(&RejectCallbacksWithError<CallbacksType>,
- blink::WebUSBError(blink::WebUSBError::Error::Service,
- base::UTF8ToUTF16(kNoServiceError))));
+ blink::WebUSBError(blink::WebUSBError::Error::NotFound,
+ base::ASCIIToUTF16(kNoServiceError))));
}
void OnGetDevicesComplete(
@@ -78,8 +78,9 @@ void OnRequestDevicesComplete(
scoped_callbacks->onSuccess(blink::adoptWebPtr(web_usb_device));
} else {
- scoped_callbacks->onSuccess(
- blink::adoptWebPtr<blink::WebUSBDevice>(nullptr));
+ scoped_callbacks->onError(
+ blink::WebUSBError(blink::WebUSBError::Error::NotFound,
+ base::ASCIIToUTF16("No device selected.")));
}
}
« no previous file with comments | « no previous file | content/renderer/usb/web_usb_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698