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

Unified Diff: device/usb/usb_context.cc

Issue 497363004: Merge components/usb_service into device/usb. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 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 | « device/usb/usb_context.h ('k') | device/usb/usb_context_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_context.cc
diff --git a/components/usb_service/usb_context.cc b/device/usb/usb_context.cc
similarity index 88%
rename from components/usb_service/usb_context.cc
rename to device/usb/usb_context.cc
index 963986a09636b9101d6e2eb3aee3a06f4523852d..72a38359593fbef9bd823828e99c22f0d39df1bb 100644
--- a/components/usb_service/usb_context.cc
+++ b/device/usb/usb_context.cc
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/usb_service/usb_context.h"
+#include "device/usb/usb_context.h"
#include "base/atomicops.h"
#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h"
-#include "components/usb_service/usb_error.h"
+#include "device/usb/usb_error.h"
#include "third_party/libusb/src/libusb/interrupt.h"
#include "third_party/libusb/src/libusb/libusb.h"
-namespace usb_service {
+namespace device {
// The UsbEventHandler works around a design flaw in the libusb interface. There
// is currently no way to signal to libusb that any caller into one of the event
@@ -34,9 +34,7 @@ class UsbContext::UsbEventHandler : public base::PlatformThread::Delegate {
};
UsbContext::UsbEventHandler::UsbEventHandler(libusb_context* context)
- : context_(context),
- thread_handle_(0),
- start_polling_(false, false) {
+ : context_(context), thread_handle_(0), start_polling_(false, false) {
base::subtle::Release_Store(&running_, 1);
bool success = base::PlatformThread::Create(0, this, &thread_handle_);
DCHECK(success) << "Failed to create USB IO handling thread.";
@@ -59,7 +57,8 @@ void UsbContext::UsbEventHandler::ThreadMain() {
while (base::subtle::Acquire_Load(&running_)) {
const int rv = libusb_handle_events(context_);
if (rv != LIBUSB_SUCCESS) {
- VLOG(1) << "Failed to handle events: " << ConvertErrorToString(rv);
+ VLOG(1) << "Failed to handle events: "
+ << ConvertPlatformUsbErrorToString(rv);
}
}
VLOG(1) << "UsbEventHandler shutting down.";
@@ -78,4 +77,4 @@ UsbContext::~UsbContext() {
libusb_exit(context_);
}
-} // namespace usb_service
+} // namespace device
« no previous file with comments | « device/usb/usb_context.h ('k') | device/usb/usb_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698