We patch NavigationRequest::OnStartChecksComplete to call MaybeHideReferrer. One of the params to MaybeHideReferrer is top document GURL which was available in OnStartCheckComplete. The Chromium change below removed it. Added a chromium_src override that includes GetTopDocumentGURL function that containes the deleted functionality. Chromium change: https://chromium.googlesource.com/chromium/src/+/435bcb58bb2c75be8276f1dde69fc6c9891c45ba commit 435bcb58bb2c75be8276f1dde69fc6c9891c45ba Author: Lukasz Anforowicz <lukasza@chromium.org> Date: Fri Jul 12 20:50:06 2019 +0000 Store |initiator_origin| in FrameNavigationEntry. Changes in this CL ================== This CL: 1. 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. 2. Updates callers of FNE::UpdateEntry and FNE's constructor to provide/propagate the initiator as needed. This includes adding an |initiator_origin| parameter to - NavigationEntryImpl's constructor - NavigationEntryImpl::AddOrUpdateFrameEntry - NavigationController::CreateNavigationEntry (the list above is not necessarily exhaustive/complete) 3. 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