We need an API to let owners of a TaskScheduler provided TaskRunner toggle priority of tasks posted to it (current and future).
This will be particularly useful for sequences that have the following pattern:
- Important read on startup
- Background writes for Chrome's lifetime
- Important writes on shutdown
Re. shutdown: while TaskScheduler automatically bumps the priority of BACKGROUND+BLOCK_SHUTDOWN tasks on TaskScheduler::Shutdown(), it's not always possible to trigger TaskScheduler::Shutdown() in code blocking on a final flush to disk -- e.g. ChromeRestartRequest::Start() or BrowserProcessImpl::EndSession().
Until we have that, we will unfortunately have to run those TaskRunners at USER_VISIBLE priority for the lifetime of the browser. Such use cases will be tagged with this issue# to be updated once this API is ready.
Comment 1 by gab@chromium.org
, Jul 21 2017