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

Unified Diff: device/usb/usb_device_handle_impl.cc

Issue 2857473002: Use the task scheduler in the USB service on macOS and Windows (Closed)
Patch Set: Add AssertIOAllowed Created 3 years, 8 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 | « no previous file | device/usb/usb_device_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_handle_impl.cc
diff --git a/device/usb/usb_device_handle_impl.cc b/device/usb/usb_device_handle_impl.cc
index ee398ed4cca0d81414c9609f7294450132c2d889..c4b6d2f48a09ed479ad29e52ff294f175e726961 100644
--- a/device/usb/usb_device_handle_impl.cc
+++ b/device/usb/usb_device_handle_impl.cc
@@ -13,10 +13,10 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string16.h"
-#include "base/synchronization/lock.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/device_event_log/device_event_log.h"
#include "device/usb/usb_context.h"
@@ -168,7 +168,7 @@ class UsbDeviceHandleImpl::InterfaceClaimer
int alternate_setting_;
const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
ResultCallback release_callback_;
- base::ThreadChecker thread_checker_;
+ base::SequenceChecker sequence_checker_;
DISALLOW_COPY_AND_ASSIGN(InterfaceClaimer);
};
@@ -183,7 +183,7 @@ UsbDeviceHandleImpl::InterfaceClaimer::InterfaceClaimer(
task_runner_(task_runner) {}
UsbDeviceHandleImpl::InterfaceClaimer::~InterfaceClaimer() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
int rc = libusb_release_interface(handle_->handle(), interface_number_);
if (rc != LIBUSB_SUCCESS) {
USB_LOG(DEBUG) << "Failed to release interface: "
« no previous file with comments | « no previous file | device/usb/usb_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698