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

Unified Diff: chrome/browser/usb/usb_context.cc

Issue 23571007: Fail gracefully when libusb_init fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-safe-exit
Patch Set: Fix tests Created 7 years, 3 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 | « chrome/browser/usb/usb_context.h ('k') | chrome/browser/usb/usb_context_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/usb/usb_context.cc
diff --git a/chrome/browser/usb/usb_context.cc b/chrome/browser/usb/usb_context.cc
index f4e55badd39dde05b6a7235b3c47a4653b3fa1d5..a09c2f69a6bb22dff919cb032627158750f647d8 100644
--- a/chrome/browser/usb/usb_context.cc
+++ b/chrome/browser/usb/usb_context.cc
@@ -60,9 +60,8 @@ void UsbContext::UsbEventHandler::ThreadMain() {
VLOG(1) << "UsbEventHandler shutting down.";
}
-UsbContext::UsbContext() : context_(NULL) {
+UsbContext::UsbContext(PlatformUsbContext context) : context_(context) {
DCHECK(thread_checker_.CalledOnValidThread());
- CHECK_EQ(0, libusb_init(&context_)) << "Cannot initialize libusb";
event_handler_ = new UsbEventHandler(context_);
}
« no previous file with comments | « chrome/browser/usb/usb_context.h ('k') | chrome/browser/usb/usb_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698