New issue
Advanced search Search tips

Issue 674914 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

WebContentsImpl::FromRenderFrameHostID returns WebContents with different IDs

Project Member Reported by alexilin@chromium.org, Dec 16 2016

Issue description

What steps will reproduce the problem?
(1) Navigate to web page with cross-origin redirect (http to https in my case).
(2) Navigate to the same page the second time from the same tab.
(3) It will cause of new renderer creation because the second navigation will be considered as new SiteInstance.
(4) Get WebContentsGetter object from request as ResourceRequestInfo::ForRequest(request)->GetWebContentsGetterForRequest();
(https://cs.chromium.org/chromium/src/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc?rcl=0&l=516)
(5) Get web_contents by call the callback from UI thread.

What is the expected result?
Values of web_contents->GetRenderProcessHost()->GetID() and
web_contents->GetMainFrame()->GetRoutingID()
match the new renderer.

What happens instead?
These values match the old renderer.

Please use labels and text to provide additional information.
The function WebContentsImpl::FromRenderFrameHostID (https://cs.chromium.org/chromium/src/content/browser/web_contents/web_contents_impl.cc?rcl=1481876342&l=666) for new renderer IDs returns WebContents connected with the old renderer.

 

Comment 1 by clamy@chromium.org, Dec 16 2016

Status: WontFix (was: Untriaged)
This is WAI. The issue you see is that you're using a _pending_ RFH to get the WebContents. But web_contents->GetRenderProcessHost()->GetID() and
web_contents->GetMainFrame()->GetRoutingID() will use the _current_ RFH (which is a different one). So until the navigation commits and the current RFH is replaced by the pending RFH, the two won't match.

Sign in to add a comment