OOPIF: Fix window.open to work from frames with remote parent.
commit4cf2aa39e2220a3b5ef50a95fc11cf4ff35a85d5
authoralexmos <alexmos@chromium.org>
Wed, 15 Jul 2015 23:40:43 +0000 (15 16:40 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 15 Jul 2015 23:42:23 +0000 (15 23:42 +0000)
tree66cc445ac5ef2ec333a3f1f7441e6cd86fb6739e
parent197e83066dc598fb0b78f83d8e98ba445f990c43
OOPIF: 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

Review URL: https://codereview.chromium.org/1224363002

Cr-Commit-Position: refs/heads/master@{#338949}
16 files changed:
content/browser/frame_host/interstitial_page_impl.cc
content/browser/frame_host/interstitial_page_impl.h
content/browser/frame_host/render_frame_host_manager_browsertest.cc
content/browser/renderer_host/render_view_host_delegate.h
content/browser/renderer_host/render_view_host_impl.cc
content/browser/site_per_process_browsertest.cc
content/browser/web_contents/web_contents_impl.cc
content/browser/web_contents/web_contents_impl.h
content/content_tests.gypi
content/public/test/browser_test_utils.cc
content/public/test/browser_test_utils.h
content/test/BUILD.gn
content/test/content_browser_test_utils_internal.cc
content/test/content_browser_test_utils_internal.h
content/test/test_web_contents.cc
content/test/test_web_contents.h