GuestViewBase::GetOwnerSiteURL needs to work before the owner commits.
Before this CL, GuestViewBase::GetOwnerSiteURL would return:
owner_web_contents()->GetLastCommittedURL()
The code above is incorrect for two reasons:
1. It doesn't account for about:blank URLs
2. It doesn't work before |owner_web_contents()| commit their first
navigation.
Problem #2 is what happens when a new, blank popup is opened and then
written to via document.write. In such scenario, GetOwnerSiteURL would
return an invalid URL which incorrectly caused PDF rendering pipeline to
fail by rejecting invalid URLs in URLPattern::MatchesURL:
URLPattern::MatchesURL()
extensions::URLPatternSet::MatchesURL()
extensions::SimpleFeature::GetContextAvailability()
extensions::SimpleFeature::IsAvailableToContext()
extensions::ExtensionsGuestViewManagerDelegate::IsGuestAvailableToContext()
^- IsGuestAvailableToContext passes result of
GetOwnerSiteURL to IsAvailableToContext above
guest_view::GuestViewBase::Init()
guest_view::GuestViewManager::CreateGuest()
extensions::MimeHandlerViewEmbedder::CreateMimeHandlerViewGuest()
Bug: 1041880
Change-Id: I252a15e464d70a7131c101b4f4889fa9fa968a66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2023047Reviewed-by:
Charlie Reis <creis@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737817}
Showing
Please register or sign in to comment