PSA: Sequenced/ThreadTaskRunnerHandle moving to Sequenced/SingleThreadTaskRunner

19 views
Skip to first unread message

Sean Maher

unread,
Sep 27, 2022, 12:30:23 PM9/27/22
to chromi...@chromium.org

Hi everyone,


FYI, as agreed upon long ago, we will be migrating base::Sequenced/ThreadTaskRunnerHandle to static APIs on base::Sequenced/SingleThreadTaskRunner.


SequencedTaskRunnerHandle::Get() => SequencedTaskRunner::GetCurrentDefault().

SequencedTaskRunnerHandle::IsSet() => SequencedTaskRunner::HasCurrentDefault().

(same for ThreadTaskRunnerHandle)


Reasons:

  • It has long been deemed confusing that ThreadTaskRunnerHandle::Get() returns the default task queue rather than the “current” one on threads with multiplexed task queues. This is intentional and this change helps make this explicit.

  • A static getter on the appropriate type is more discoverable/intuitive than a separate handle type.


The new API just landed along with an update to the MD documentation. A mass migration will shortly follow and the old API is expected to be gone within a few weeks.


Cheers,

Sean
Reply all
Reply to author
Forward
0 new messages