| 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
|
|
|