Store |initiator_origin| in FrameNavigationEntry. #17497
Merged
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.
Changes in this CL
This CL:
Updates FrameNavigationEntry::UpdateEntry and
FrameNavigationEntry's constructor so that they both take
|const base::Optional<url::Origin>& initiator_origin| which
gets stored in a new FrameNavigationEntry::initiator_origin_ field.
Updates callers of FNE::UpdateEntry and FNE's constructor to
provide/propagate the initiator as needed. This includes
adding an |initiator_origin| parameter to
(the list above is not necessarily exhaustive/complete)
Uses the new |FrameNavigationEntry::initiator_origin()| from
NavigationEntryImpl::ConstructCommonNavigationParams (which
used to always provide |base::nullopt| initiator for history
navigations - always treating them as browser-initiated, rather
than replaying the original initiator).
The changes above makes sure that the right Sec-Fetch-Site http request header is
"replayed" during history navigations. The CL adds browser tests and
WPT tests to cover the new, desired behavior.
Follow-up changes
This CL does not:
Use |FrameNavigationEntry::initiator_origin()| in GetOriginForURLLoaderFactory
in render_frame_host_impl.cc (this will be done in a follow-up CL at
https://crrev.com/c/1672176)
Handle persisting |FrameNavigationEntry::initiator_origin()| for
session restore (this is tracked in a separate https://crbug.com/976055).
Bug: 946503
Change-Id: I4f92614873a5ec8d4b52d3ae22031c7089d87ed5
Tbr: skuhne@chromium.org for //components/sessions
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1662738
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677046}