Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set initiatorType to "early-hints" for Early Hints preloaded resources #29340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jun 11, 2021

This CL sets initiatorType of PerformanceResourceTiming to "early-hints"
when the resource is preloaded via a 103 Early Hints response. See [1]
for the motivation.

Early Hints preloads are handled in the browser process before the
navigation commit. This means that information related to Early Hints
preloads need to be plumbed from the browser to the page's renderer
process so that the ResourceFetcher in the renderer process can set
initatorType to "early-hints". The propagation works as follows:

[browser process]
(navigation commit)
=> NavigationRequest gets information related to preloads from
NavigaitonEarlyHintsManager
=> These information are set to mojom::CommitNavigationParams

[renderer process]
(RenderFrameImpl receives mojom::CommitNavigationParams)
=> RenderFrameImpl converts mojom::CommitNavigationParams to
WebNavigationParams then passes it to DocumentLoader
=> FrameFetchContext creates a ResourceFetcher from DocumentLoader and
passes information related to Early Hints preloads to the fetcher
via DocumentLoader

When the ResourceFetcher fetches a resource it looks up Early Hints
preloads. If there is matching URL, it sets initiatorType to
"early-hints".

[1] w3c/resource-timing#273 (comment)

Bug: 1212542
Change-Id: I76d045a3bceace25a5aeb34351008fed26f587fa
Reviewed-on: https://chromium-review.googlesource.com/2909350
WPT-Export-Revision: 253fa61a5e33ef9641d96cb642add2a07a2dbabd

This CL sets initiatorType of PerformanceResourceTiming to "early-hints"
when the resource is preloaded via a 103 Early Hints response. See [1]
for the motivation.

Early Hints preloads are handled in the browser process before the
navigation commit. This means that information related to Early Hints
preloads need to be plumbed from the browser to the page's renderer
process so that the ResourceFetcher in the renderer process can set
initatorType to "early-hints". The propagation works as follows:

[browser process]
(navigation commit)
=> NavigationRequest gets information related to preloads from
   NavigaitonEarlyHintsManager
=> These information are set to mojom::CommitNavigationParams

[renderer process]
(RenderFrameImpl receives mojom::CommitNavigationParams)
=> RenderFrameImpl converts mojom::CommitNavigationParams to
   WebNavigationParams then passes it to DocumentLoader
=> FrameFetchContext creates a ResourceFetcher from DocumentLoader and
   passes information related to Early Hints preloads to the fetcher
   via DocumentLoader

When the ResourceFetcher fetches a resource it looks up Early Hints
preloads. If there is matching URL, it sets initiatorType to
"early-hints".

[1] w3c/resource-timing#273 (comment)

Bug: 1212542
Change-Id: I76d045a3bceace25a5aeb34351008fed26f587fa
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

The review process for this patch is being conducted in the Chromium project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants