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

Unified Diff: device/usb/usb_service_impl.cc

Issue 2905153002: Move off of deprecated base::NonThreadSafe in device/ (Closed)
Patch Set: ThreadChecker => SequenceChecker Created 3 years, 7 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_service.cc ('k') | device/usb/usb_service_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_service_impl.cc
diff --git a/device/usb/usb_service_impl.cc b/device/usb/usb_service_impl.cc
index 13cb14c95e3aa6ef63abc9a06ecf23dc693d8969..7322f9bfb645fd406547c2f0c575204cd60628d7 100644
--- a/device/usb/usb_service_impl.cc
+++ b/device/usb/usb_service_impl.cc
@@ -236,7 +236,7 @@ UsbServiceImpl::~UsbServiceImpl() {
}
void UsbServiceImpl::GetDevices(const GetDevicesCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (usb_unavailable_) {
task_runner()->PostTask(
@@ -308,7 +308,7 @@ void UsbServiceImpl::OnUsbContext(scoped_refptr<UsbContext> context) {
}
void UsbServiceImpl::RefreshDevices() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!context_ || enumeration_in_progress_)
return;
@@ -331,7 +331,7 @@ void UsbServiceImpl::RefreshDevices() {
void UsbServiceImpl::OnDeviceList(libusb_device** platform_devices,
size_t device_count) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!platform_devices) {
RefreshDevicesComplete();
return;
@@ -395,7 +395,7 @@ void UsbServiceImpl::OnDeviceList(libusb_device** platform_devices,
}
void UsbServiceImpl::RefreshDevicesComplete() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(enumeration_in_progress_);
enumeration_ready_ = true;
@@ -530,7 +530,7 @@ int LIBUSB_CALL UsbServiceImpl::HotplugCallback(libusb_context* context,
}
void UsbServiceImpl::OnPlatformDeviceAdded(PlatformUsbDevice platform_device) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!base::ContainsKey(platform_devices_, platform_device));
EnumerateDevice(platform_device, base::Bind(&base::DoNothing));
libusb_unref_device(platform_device);
@@ -538,7 +538,7 @@ void UsbServiceImpl::OnPlatformDeviceAdded(PlatformUsbDevice platform_device) {
void UsbServiceImpl::OnPlatformDeviceRemoved(
PlatformUsbDevice platform_device) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
PlatformDeviceMap::iterator it = platform_devices_.find(platform_device);
if (it != platform_devices_.end()) {
RemoveDevice(it->second);
« no previous file with comments | « device/usb/usb_service.cc ('k') | device/usb/usb_service_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698