service worker: Prioritize registration job

I observed a considerable delay between ServiceWorkerRegisterJob::Start()
and ServiceWorkerRegisterJob::StartImpl() while I was running web_tests.
The slowness came from PostAfterStartupTask() as it delays the start
task until after startup. This CL changes to use PostTaskWithTraits to
set job priority. Use the current task priority for registration as
it is an exposed web API that may have user interactions. Use
BEST_EFFORT for update case.

Bug: 939250
Change-Id: I0a9eb627e2668b6758fb81079a8caa0fd8d4846a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505745
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Makoto Shimazu <shimazu@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639739}
1 file changed