Use correct origin as a request initiator.
SearchEngineTabHelper::PageHasOpenSearchDescriptionDocument makes network requests on behalf of the main frame (using the URLLoaderFactory created via main frame's RFHI::CreateNetworkServiceDefaultFactory). Before this CL, the |initiator| argument of ScheduleDownload method would be incorrectly set based on WebContents::GetURL method. This was incorrect because: - WebContents::GetURL returns the "visible", rather than "committed" URL - iframe sandbox attribute is ignored (see //docs/security/origin-vs-url.md for more details) This CL fixes this by changing: url::Origin::Create(web_contents->GetURL()) into frame->GetLastCommittedOrigin() Bug: 237908 Change-Id: I8d7eef091aeaf26c7f6c65a03009cdf9713d5346 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913969Reviewed-by:Nasko Oskov <nasko@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/master@{#715732}
Showing
Please register or sign in to comment