DescriptionOOPIF: Fix window.open to work from frames with remote parent.
This CL addresses these remaining issues with that scenario:
1. WebContentsImpl::CreateNewWindow kills a renderer opening a new
window if the renderer's process doesn't match the process for
WebContents' main frame. This CL modifies this check to instead
look at all renderer processes under the current WebContents.
2. The popup was getting created in the wrong SiteInstance,
always using the SiteInstance of the WebContents' main frame rather
than the SiteInstance of the source frame. This CL fixes this by
plumbing the source frame's SiteInstance into
WebContentsImpl::CreateNewWindow.
3. Once created, the popup wasn't being shown. This is because the
message to show it (ViewHostMsg_ShowView) is sent via the opener's
RenderView, which in this case is swapped out. This caused
RenderViewHostImpl::OnShowView to exit early because it checked
is_active_. To fix this, this CL removes this check from ShowView.
Eventually, this IPC should be moved to RenderFrameHost.
BUG=463949, 225940
Committed: https://crrev.com/4cf2aa39e2220a3b5ef50a95fc11cf4ff35a85d5
Cr-Commit-Position: refs/heads/master@{#338949}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #
Total comments: 13
Patch Set 4 : Address Charlie's comments #
Total comments: 6
Patch Set 5 : Move OpenPopup to content_browser_test_utils_internal.cc, add back two is_active_ checks. #
Total comments: 1
Patch Set 6 : Fix Charlie's about:blank nit #Patch Set 7 : Try to fix undefined references to ShellAddedObserver #Patch Set 8 : Fix GN builds too #
Total comments: 4
Patch Set 9 : Rebase #Patch Set 10 : Remove internal:: from ToRenderFrameHost #Messages
Total messages: 23 (4 generated)
|