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

Unified Diff: ui/events/ozone/device/device_manager_manual.cc

Issue 2603163002: Use TaskScheduler instead of WorkerPool in device_manager_manual.cc. (Closed)
Patch Set: Created 3 years, 12 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/device/device_manager_manual.cc
diff --git a/ui/events/ozone/device/device_manager_manual.cc b/ui/events/ozone/device/device_manager_manual.cc
index aabb0a7d3ada261c6e32273e89bc290ad03b5b9d..ac46854861c0460cb8a8f6c439244273b04e97ec 100644
--- a/ui/events/ozone/device/device_manager_manual.cc
+++ b/ui/events/ozone/device/device_manager_manual.cc
@@ -8,7 +8,7 @@
#include "base/callback.h"
#include "base/files/file_enumerator.h"
#include "base/location.h"
-#include "base/threading/worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "ui/events/ozone/device/device_event.h"
#include "ui/events/ozone/device/device_event_observer.h"
@@ -43,11 +43,14 @@ void DeviceManagerManual::ScanDevices(DeviceEventObserver* observer) {
}
} else {
std::vector<base::FilePath>* result = new std::vector<base::FilePath>();
- base::WorkerPool::PostTaskAndReply(
- FROM_HERE, base::Bind(&ScanDevicesOnWorkerThread, result),
+ base::PostTaskWithTraitsAndReply(
+ FROM_HERE, base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .MayBlock(),
+ base::Bind(&ScanDevicesOnWorkerThread, result),
base::Bind(&DeviceManagerManual::OnDevicesScanned,
- weak_ptr_factory_.GetWeakPtr(), base::Owned(result)),
- false /* task_is_slow */);
+ weak_ptr_factory_.GetWeakPtr(), base::Owned(result)));
have_scanned_devices_ = true;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698