Reland "[TaskScheduler]: Simplify sequence preemption logic." This is a reland of 5d4c05db6d02f9422b3a7b6fb2b6b637691ccc2e Problem: PlatformNativeWorkerPool::RunNextSequenceImpl expects sequence returned from GetWork() to be non-null and DCHECK. Solution: Handle null sequences by skipping RunAndPopNextTask. Original change's description: > [TaskScheduler]: Simplify sequence preemption logic. > > This CL removes preempted sequences from TaskTracker, > removing need for CanScheduleSequenceObserver and > simplifying shutdown. > A CanRunPolicy enum is used instead, specifying whether > or not tasks at a given priority can run. > When CanRunPolicy is updated, wakeup workers needs > to be done as appropriate. > > In addition, Shutdown was split in 2 phases start + complete > to allow caller (TaskScheduler) to update CanRunPolicy after > shutdown was started. > > This CL was recycled from: > https://chromium-review.googlesource.com/c/chromium/src/+/1478007 > I took ownership because simplifying Sequence lifecycle > will simplify implementation of job API. > > TBR=gab@chromium.org > > Bug: 889029 > Change-Id: Ie5dbc226705880c5e598e013aa2dd3e7e874158b > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531161 > Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org> > Reviewed-by: François Doray <fdoray@chromium.org> > Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org> > Cr-Commit-Position: refs/heads/master@{#648346} Bug: 889029, 950383 Change-Id: I1f64517d312e65fb59ae235373b4f4d504da87dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1557861 Commit-Queue: François Doray <fdoray@chromium.org> Reviewed-by: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#649399}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .