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
Commit-Queue: Kenichi Ishibashi <>
Reviewed-by: Makoto Shimazu <>
Reviewed-by: Kinuko Yasuda <>
Reviewed-by: Matt Falkenhagen <>
Cr-Commit-Position: refs/heads/master@{#639739}
1 file changed