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

Unified Diff: device/usb/usb_service.cc

Issue 2864473002: Declare TaskTraits for blocking USB tasks in a constexpr (Closed)
Patch Set: Rebased 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.h ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_service.cc
diff --git a/device/usb/usb_service.cc b/device/usb/usb_service.cc
index 41b9b1421c755758a959bc964d934411e3e85716..4e1509169724a8f23e557c331835d32174ea9252 100644
--- a/device/usb/usb_service.cc
+++ b/device/usb/usb_service.cc
@@ -43,6 +43,9 @@ void UsbService::Observer::OnDeviceRemovedCleanup(
void UsbService::Observer::WillDestroyUsbService() {}
+// Declare storage for this constexpr.
+constexpr base::TaskTraits UsbService::kBlockingTaskTraits;
+
// static
std::unique_ptr<UsbService> UsbService::Create() {
#if defined(OS_ANDROID)
@@ -64,9 +67,7 @@ std::unique_ptr<UsbService> UsbService::Create() {
// static
scoped_refptr<base::SequencedTaskRunner>
UsbService::CreateBlockingTaskRunner() {
- return base::CreateSequencedTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::USER_VISIBLE,
- base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN});
+ return base::CreateSequencedTaskRunnerWithTraits(kBlockingTaskTraits);
}
UsbService::~UsbService() {
« no previous file with comments | « device/usb/usb_service.h ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698