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

Unified Diff: device/usb/usb_service_impl.cc

Issue 2855233002: Use constexpr TaskTraits constructor in device. (Closed)
Patch Set: 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 | « device/usb/usb_service.cc ('k') | no next file » | 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 dba15d978a1564ddab092ba409003bb6a0e41f04..9881c7443bc157ec306166d51ed0aa016d7deee6 100644
--- a/device/usb/usb_service_impl.cc
+++ b/device/usb/usb_service_impl.cc
@@ -225,11 +225,8 @@ UsbServiceImpl::UsbServiceImpl()
weak_factory_(this) {
base::PostTaskWithTraits(
FROM_HERE,
- base::TaskTraits()
- .MayBlock()
- .WithPriority(base::TaskPriority::USER_VISIBLE)
- .WithShutdownBehavior(
- base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ {base::MayBlock(), base::TaskPriority::USER_VISIBLE,
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::Bind(&InitializeUsbContextOnBlockingThread, task_runner(),
base::Bind(&UsbServiceImpl::OnUsbContext,
weak_factory_.GetWeakPtr())));
@@ -329,17 +326,13 @@ void UsbServiceImpl::RefreshDevices() {
pending_path_enumerations_.pop();
}
- base::PostTaskWithTraits(
- FROM_HERE,
- base::TaskTraits()
- .MayBlock()
- .WithPriority(base::TaskPriority::USER_VISIBLE)
- .WithShutdownBehavior(
- base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
- base::Bind(&GetDeviceListOnBlockingThread, device_path, context_,
- task_runner(),
- base::Bind(&UsbServiceImpl::OnDeviceList,
- weak_factory_.GetWeakPtr())));
+ base::PostTaskWithTraits(FROM_HERE,
+ {base::MayBlock(), base::TaskPriority::USER_VISIBLE,
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
Reilly Grant (use Gerrit) 2017/05/03 20:27:00 Since these are the same traits I use in UsbServic
fdoray 2017/05/03 20:45:44 This would indeed be a nice improvement but in the
+ base::Bind(&GetDeviceListOnBlockingThread,
+ device_path, context_, task_runner(),
+ base::Bind(&UsbServiceImpl::OnDeviceList,
+ weak_factory_.GetWeakPtr())));
}
void UsbServiceImpl::OnDeviceList(libusb_device** platform_devices,
« no previous file with comments | « device/usb/usb_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698