Consolidate iframe & object resource timing code paths #38348
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So far some of the logic in resource timing for subframe navigations
iframe/object/embed) was duplicated, e.g. both in blink and in content.
This has led to race conditions, inconsistencies and sometimes
XSS leaks.
This patch attempts to improve the situation by consolidating the code
paths:
NavigationRequest receives is_container_initiated, which ensures only
container-initiated navigations are reported to the parent. This
is a clarification of something that was ambiguous in the spec
previously (iframe resource timing: entry should only be created for frame-initiated navigation whatwg/html#8846).
It later uses ParentResourceTimingAccess to decide if a navigation
should report to its parent with/without response details
(status code and mime-type), or not report at all (TAO-fail, not
an iframe, not container-initiated).
Both object fallbacks and cancelled navigations (204/205) report
to the parent via RenderFrameImpl, and blink converts that to a
ResourceTimingInfo object. This allows us to remove the duplicated
resource timing creation code in //content.
We report fallback resource timing also for plugin error events and
not only for load events.
Bug: 1399862
Bug: 1410705
Change-Id: Id37d23cd02eee9e38f812e6f3da99caedafdee3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4214695
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110433}
Revert "Consolidate iframe & object resource timing code paths"
This reverts commit 5dcb6f7b01d5f51144a9ba847c34bb0cdc344ccb.
Reason for revert: MSan failures crbug.com/1420057
Change-Id: Id37d23cd02eee9e38f812e6f3da99caedafdee3d