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

Unified Diff: ui/events/platform/x11/x11_hotplug_event_handler.cc

Issue 2860703002: Use TaskScheduler instead of WorkerPool in x11_hotplug_event_handler.cc. (Closed)
Patch Set: Add ScopedTaskEnvironment in SoftwareOutputDeviceOzoneTest 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 | « ui/compositor/test/test_suite.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/platform/x11/x11_hotplug_event_handler.cc
diff --git a/ui/events/platform/x11/x11_hotplug_event_handler.cc b/ui/events/platform/x11/x11_hotplug_event_handler.cc
index be7bb0911d20c6c3339396ab3d825d17f26f1f8e..f011c73a6e3d0952de7ed9f616f596773acd6f52 100644
--- a/ui/events/platform/x11/x11_hotplug_event_handler.cc
+++ b/ui/events/platform/x11/x11_hotplug_event_handler.cc
@@ -23,8 +23,8 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
#include "base/sys_info.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "base/threading/worker_pool.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/devices/device_hotplug_event_observer.h"
#include "ui/events/devices/device_util_linux.h"
@@ -493,14 +493,14 @@ void X11HotplugEventHandler::OnHotplugEvent() {
callbacks.touchpad_callback = base::Bind(&OnTouchpadDevices);
callbacks.hotplug_finished_callback = base::Bind(&OnHotplugFinished);
- // Parsing the device information may block, so delegate the operation to a
- // worker thread. Once the device information is extracted the parsed devices
- // will be returned via the callbacks.
- base::WorkerPool::PostTask(
+ // Parse the device information asynchronously since this operation may block.
+ // Once the device information is extracted the parsed devices will be
+ // returned via the callbacks.
+ base::PostTaskWithTraits(
FROM_HERE,
- base::Bind(&HandleHotplugEventInWorker, device_infos, display_state,
- base::ThreadTaskRunnerHandle::Get(), callbacks),
- true /* task_is_slow */);
+ {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
+ base::BindOnce(&HandleHotplugEventInWorker, device_infos, display_state,
+ base::ThreadTaskRunnerHandle::Get(), callbacks));
}
} // namespace ui
« no previous file with comments | « ui/compositor/test/test_suite.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698