New issue
Advanced search Search tips

Issue 793047 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 769449
issue 770239



Sign in to add a comment

With --site-per-process LoadDataWithBaseURL locks to a different origin than it eventually commits to

Project Member Reported by lukasza@chromium.org, Dec 7 2017

Issue description

When running NavigationControllerBrowserTest.LoadDataWithBaseURL I observe the following:

1. Navigation starts: NavigationControllerImpl::LoadURLParams; params.url = data:text/html;charset=utf-8,<html><body>foo</body></html>; params.base_url_for_data_url = http://baseurl/

2. Response starts.  Because of --site-per-process, target process is locked to an origin: LockToOrigin; gurl = data:

3. Navigation commits with validated_params->url = data:text/html;charset=utf-8,<html><body>foo</body></html>; validated_params->origin = http://baseurl

EXPECTED BEHAVIOR:

Origin reported back in DidCommitProvisionalLoad is compatible with the origin lock for the process.


ACTUAL BEHAVIOR:

Origin reported back in DidCommitProvisionalLoad fails IsSuitableHost checks.

 
In LoadDataWithBaseURL scenarios, the renderer legitimately thinks that it committed with baseURL origin.  Therefore if we decide to lock the renderer process to an origin, we should lock it to baseURL (for sanity/consistency + to avoid having to carve-out special enforcement exceptions for baseURL scenarios).  I think that this can be done by tweaking NavigationRequest::OnResponseStarted so that it considers |common_params_.base_url_for_data_url| before calling SiteInstanceImpl::SetSite.

After making the change described above, the test gets a bit further, but
1) the test still fails
2) I see that we still use the data URI as a site url:
[123412:123412:1207/153059.086240:ERROR:site_instance_impl.cc(155)] SetSite; gurl = data:text/html;charset=utf-8,<html><body>foo</body></html>; stack = #0 0x7fdf24e46c0d base::debug::StackTrace::StackTrace()
#1 0x7fdf24e4503c base::debug::StackTrace::StackTrace()
#2 0x7fdf216777c7 content::SiteInstanceImpl::SetSite()
#3 0x7fdf20a5ca2e content::BrowsingInstance::GetSiteInstanceForURL()
#4 0x7fdf2167867b content::SiteInstanceImpl::GetRelatedSiteInstance()
#5 0x7fdf20ec2f94 content::RenderFrameHostManager::ConvertToSiteInstance()
#6 0x7fdf20ec1d26 content::RenderFrameHostManager::GetSiteInstanceForNavigation()
#7 0x7fdf20ebe508 content::RenderFrameHostManager::GetSiteInstanceForNavigationRequest()
#8 0x7fdf20ebd4a2 content::RenderFrameHostManager::GetFrameHostForNavigation()
#9 0x7fdf20ebd230 content::RenderFrameHostManager::DidCreateNavigationRequest()
#10 0x7fdf20dee9b8 content::FrameTreeNode::CreatedNavigationRequest()
#11 0x7fdf20e57691 content::NavigatorImpl::RequestNavigation()
#12 0x7fdf20e56071 content::NavigatorImpl::NavigateToEntry()
#13 0x7fdf20e57f98 content::NavigatorImpl::NavigateToPendingEntry()
#14 0x7fdf20e1acfa content::NavigationControllerImpl::NavigateToPendingEntryInternal()
#15 0x7fdf20e0bffe content::NavigationControllerImpl::NavigateToPendingEntry()
#16 0x7fdf20e0b95e content::NavigationControllerImpl::Reload()
#17 0x000001ee82d2 content::Shell::Reload()
#18 0x000001d037df content::ReloadBlockUntilNavigationsComplete()
#19 0x0000009ed5ff content::NavigationControllerBrowserTest_LoadDataWithBaseURL_Test::RunTestOnMainThread()


Blocking: 769449

Sign in to add a comment