service worker: Create timeout timer immediately after context creation

Before this CL ServiceWorkerTimeoutTimer was created in
SendWorkerStarted() which is an async task scheduled after script
evaluation. This meant that there was a timing where the timeout timer
wasn't created yet but ServiceWorkerContextClient::WillStartTask() tried
to use the timer. This CL moves creation of the timer immediately after
context creation to avoid such situation.

Bug: 928568
Change-Id: I937a6595372d518f448f1112df963cd7a2bb34bc
Commit-Queue: Kenichi Ishibashi <>
Reviewed-by: Makoto Shimazu <>
Reviewed-by: Matt Falkenhagen <>
Cr-Commit-Position: refs/heads/master@{#631529}
5 files changed