Cap number of TaskPriority::BACKGROUND tasks in a TaskScheduler.

With this CL, it is possible to set a cap on the number of
TaskPriority::BACKGROUND tasks that are scheduled in a
TaskScheduler instance.

The next step will be to merge the background and foreground
pools on platforms that don't support thread priorities.
Code from this CL will ensure that background tasks never
use all available threads in a pool.

Bug: 728208
Change-Id: Ide746d3a876e78d1c9f9211a69d49f892b6e1a92
Reviewed-on: https://chromium-review.googlesource.com/615903
Reviewed-by: Robert Liao <robliao@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508371}

CrOS-Libchrome-Original-Commit: ffe691baf5e725ca953d49b97a97741ae1df41e5
15 files changed
tree: ac533badb2e9b89ec61f299d5e63ea18a9335712
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/