Commit db005758 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off base::ThreadPool()-as-a-trait in /services/device/generic_sensor

This CL is a logical no-op.

It manually covers the use cases the script
(https://crbug.com/1026641#c22) didn't cover in
https://chromium-review.googlesource.com/c/chromium/src/+/2026350.

A few of the affected files were also migrated to
content::GetUIThreadTaskRunner() whenever surrounding code consistency
was at stake (but the bulk of that migration is staged to happen after
this one so this wasn't a priority in this batch).

Most files intentionally kept base/task/post_task.h as an include. It is
still required because of a cyclical dependency during the migration
preventing base/task/thread_pool.h from implicitly providing
base/task/task_traits.h to its users (callers that explicitly store
TaskTraits and include task_traits.h don't have this problem). The
post_task.h include will be cleaned up in a later phase.

This CL was uploaded by git cl split.

R=juncai@chromium.org

Bug: 1026641
Change-Id: I14264a1265eb4675548aa40f0003c6fd5a8961f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079076Reviewed-by: default avatarJun Cai <juncai@chromium.org>
Commit-Queue: Jun Cai <juncai@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745549}
parent c522f68d
......@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/memory/ref_counted.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/task_runner_util.h"
#include "services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.h"
#include "services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer.h"
......@@ -25,7 +26,7 @@ namespace device {
namespace {
constexpr base::TaskTraits kBlockingTaskRunnerTraits = {
base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN};
bool IsFusionSensorType(mojom::SensorType type) {
......@@ -45,8 +46,8 @@ bool IsFusionSensorType(mojom::SensorType type) {
PlatformSensorProviderLinux::PlatformSensorProviderLinux()
: sensor_nodes_enumerated_(false),
sensor_nodes_enumeration_started_(false),
blocking_task_runner_(
base::CreateSequencedTaskRunner(kBlockingTaskRunnerTraits)),
blocking_task_runner_(base::ThreadPool::CreateSequencedTaskRunner(
kBlockingTaskRunnerTraits)),
sensor_device_manager_(nullptr,
base::OnTaskRunnerDeleter(blocking_task_runner_)) {
sensor_device_manager_.reset(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment