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

Unified Diff: components/usb_service/usb_context.cc

Issue 344793009: Log errors from libusb. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « components/usb_service.gypi ('k') | components/usb_service/usb_device_handle_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/usb_service/usb_context.cc
diff --git a/components/usb_service/usb_context.cc b/components/usb_service/usb_context.cc
index be8313e6a86b65f5e5beed873e061f735b814871..67403c83e518bbfb49bcc36040eac1ce5de76603 100644
--- a/components/usb_service/usb_context.cc
+++ b/components/usb_service/usb_context.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h"
+#include "components/usb_service/usb_error.h"
#include "third_party/libusb/src/libusb/interrupt.h"
#include "third_party/libusb/src/libusb/libusb.h"
@@ -54,10 +55,13 @@ void UsbContext::UsbEventHandler::ThreadMain() {
VLOG(1) << "UsbEventHandler started.";
if (running_) {
start_polling_.Signal();
- libusb_handle_events(context_);
}
- while (running_)
- libusb_handle_events(context_);
+ while (running_) {
+ const int rv = libusb_handle_events(context_);
+ if (rv != LIBUSB_SUCCESS) {
+ LOG(WARNING) << "Failed to handle events: " << ConvertErrorToString(rv);
+ }
+ }
VLOG(1) << "UsbEventHandler shutting down.";
}
« no previous file with comments | « components/usb_service.gypi ('k') | components/usb_service/usb_device_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698