OMT worker fetch: Record resource timing of the main script in Document's Performance Timeline

See the bug ( description for the motivation of this change.

This CL introduces WorkerResourceTimingNotifier to plumb resource timing info to an
appropriate Performance Timeline. WorkerFetchContext uses the notifier to add resource
timing info. The notifier has an associated execution context which has the
Performance Timeline the info should be added.

As described in the bug description, the thread associated with the execution
context may be different from the current running thread. In that case the
notifier creates a copy of the info and posts a cross thread task to add the

Since blink::ResourceTimingInfo is not safe to pass across threads,
WorkerResourceTimingNotifier takes WebResourceTimingInfo as an argument.
WebResourceTimingInfo implements CrossThreadCopier.

This CL only covers classic scripts. In a follow-up CL I'll add support for
module scripts.

Change-Id: I82db5086c5a472f0493123e180d241712a01170a
Bug: 928146
Commit-Queue: Kenichi Ishibashi <>
Reviewed-by: Kinuko Yasuda <>
Reviewed-by: Matt Falkenhagen <>
Reviewed-by: Hiroshige Hayashizaki <>
Reviewed-by: Hiroki Nakagawa <>
Cr-Commit-Position: refs/heads/master@{#653871}
27 files changed