The TaskQueueManager's internal::TaskQueue now has a priority
commit546ca22ac2fd1bfddcb674813c7777041508dc27
authoralexclarke <alexclarke@chromium.org>
Wed, 18 Mar 2015 19:06:57 +0000 (18 12:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 18 Mar 2015 19:07:41 +0000 (18 19:07 +0000)
tree78397bd39d6c7ae7f4af3c0a8e122a6f0332e3b8
parentebba195d3311fce09e983ca3b82ab0d934d8c9c2
The TaskQueueManager's internal::TaskQueue now has a priority
queue of delayed tasks.  When these tasks are ready to
execute, they are enqueued on the normal task queue.

The main motivation for doing this is so that delayed
tasks posted from Blink can be properly flushed when the
scheduler shuts down.  This is important because we would
otherwise risk leaving tasks allocated on the Blink Heap
that has gone away.

Benchmarking suggests that the overhead of this approach is
actually a bit lower than posting to the base MessageLoop
when posting lots of delayed tasks.

BUG=463143

Review URL: https://codereview.chromium.org/1008693004

Cr-Commit-Position: refs/heads/master@{#321183}
cc/test/ordered_simple_task_runner.cc
cc/test/ordered_simple_task_runner.h
cc/test/test_now_source.cc
cc/test/test_now_source.h
content/renderer/scheduler/task_queue_manager.cc
content/renderer/scheduler/task_queue_manager.h
content/renderer/scheduler/task_queue_manager_unittest.cc