Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Issue 1224363002: OOPIF: Fix window.open to work from frames with remote parent. (Closed)

Created:
5 years, 5 months ago by alexmos
Modified:
5 years, 5 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, nasko+codewatch_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+162 lines, -61 lines) Patch
M content/browser/frame_host/interstitial_page_impl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/interstitial_page_impl.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +11 lines, -18 lines 0 comments Download
M content/browser/renderer_host/render_view_host_delegate.h View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -4 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -7 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 1 chunk +65 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 4 chunks +25 lines, -11 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M content/public/test/browser_test_utils.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -6 lines 0 comments Download
M content/public/test/browser_test_utils.cc View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -8 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/test/content_browser_test_utils_internal.h View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -0 lines 0 comments Download
M content/test/content_browser_test_utils_internal.cc View 1 2 3 4 5 6 7 8 9 2 chunks +21 lines, -0 lines 0 comments Download
M content/test/test_web_contents.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/test/test_web_contents.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 23 (4 generated)
alexmos
Charlie, can you please take a look? With this, we should be able to open ...
5 years, 5 months ago (2015-07-09 22:14:06 UTC) #2
Charlie Reis
Nice-- I'm excited to have this case working! This is probably ok as is, but ...
5 years, 5 months ago (2015-07-09 23:42:51 UTC) #3
alexmos
https://codereview.chromium.org/1224363002/diff/40001/content/browser/renderer_host/render_view_host_delegate.h File content/browser/renderer_host/render_view_host_delegate.h (right): https://codereview.chromium.org/1224363002/diff/40001/content/browser/renderer_host/render_view_host_delegate.h#newcode198 content/browser/renderer_host/render_view_host_delegate.h:198: // should be created associated with the given |route_id| ...
5 years, 5 months ago (2015-07-10 18:35:01 UTC) #4
Charlie Reis
Great, thanks. LGTM with nits! https://codereview.chromium.org/1224363002/diff/40001/content/browser/renderer_host/render_view_host_impl.cc File content/browser/renderer_host/render_view_host_impl.cc (left): https://codereview.chromium.org/1224363002/diff/40001/content/browser/renderer_host/render_view_host_impl.cc#oldcode1006 content/browser/renderer_host/render_view_host_impl.cc:1006: if (is_active_) { On ...
5 years, 5 months ago (2015-07-10 21:44:49 UTC) #5
alexmos
Thanks! You may want to take a quick look at the moved and slightly changed ...
5 years, 5 months ago (2015-07-10 23:03:03 UTC) #6
Charlie Reis
Thanks! LGTM with nit. https://codereview.chromium.org/1224363002/diff/80001/content/browser/frame_host/render_frame_host_manager_browsertest.cc File content/browser/frame_host/render_frame_host_manager_browsertest.cc (right): https://codereview.chromium.org/1224363002/diff/80001/content/browser/frame_host/render_frame_host_manager_browsertest.cc#newcode570 content/browser/frame_host/render_frame_host_manager_browsertest.cc:570: OpenPopup(shell()->web_contents(), GURL("about:blank"), "foo"); url::kAboutBlankURL (here ...
5 years, 5 months ago (2015-07-11 00:12:08 UTC) #7
alexmos
Hey Charlie, turns out that moving OpenPopup to content_browser_test_utils_internal.cc introduced some build failures (see PS5 ...
5 years, 5 months ago (2015-07-13 21:40:03 UTC) #8
Charlie Reis
On 2015/07/13 21:40:03, alexmos wrote: > Hey Charlie, turns out that moving OpenPopup to > ...
5 years, 5 months ago (2015-07-13 22:40:45 UTC) #9
alexmos
On 2015/07/13 22:40:45, Charlie Reis wrote: > On 2015/07/13 21:40:03, alexmos wrote: > > Hey ...
5 years, 5 months ago (2015-07-13 23:47:52 UTC) #10
Charlie Reis
On 2015/07/13 23:47:52, alexmos wrote: > On 2015/07/13 22:40:45, Charlie Reis wrote: > > On ...
5 years, 5 months ago (2015-07-13 23:57:25 UTC) #12
alexmos
Pawel - friendly ping
5 years, 5 months ago (2015-07-15 15:32:35 UTC) #13
Paweł Hajdan Jr.
I'm fine with the gyp/GN changes (content_browser_test_support is more specific than test_support_content so moving content/test/content_browser_test_utils_internal ...
5 years, 5 months ago (2015-07-15 17:30:33 UTC) #14
alexmos
Thanks! https://codereview.chromium.org/1224363002/diff/140001/content/test/content_browser_test_utils_internal.h File content/test/content_browser_test_utils_internal.h (right): https://codereview.chromium.org/1224363002/diff/140001/content/test/content_browser_test_utils_internal.h#newcode17 content/test/content_browser_test_utils_internal.h:17: #include "content/public/test/browser_test_utils.h" On 2015/07/15 17:30:33, Paweł Hajdan Jr. ...
5 years, 5 months ago (2015-07-15 17:40:23 UTC) #15
Paweł Hajdan Jr.
https://codereview.chromium.org/1224363002/diff/140001/content/test/content_browser_test_utils_internal.h File content/test/content_browser_test_utils_internal.h (right): https://codereview.chromium.org/1224363002/diff/140001/content/test/content_browser_test_utils_internal.h#newcode17 content/test/content_browser_test_utils_internal.h:17: #include "content/public/test/browser_test_utils.h" On 2015/07/15 at 17:40:23, alexmos wrote: > ...
5 years, 5 months ago (2015-07-15 17:50:15 UTC) #16
alexmos
https://codereview.chromium.org/1224363002/diff/140001/content/test/content_browser_test_utils_internal.h File content/test/content_browser_test_utils_internal.h (right): https://codereview.chromium.org/1224363002/diff/140001/content/test/content_browser_test_utils_internal.h#newcode17 content/test/content_browser_test_utils_internal.h:17: #include "content/public/test/browser_test_utils.h" On 2015/07/15 17:50:15, Paweł Hajdan Jr. wrote: ...
5 years, 5 months ago (2015-07-15 18:29:04 UTC) #17
Paweł Hajdan Jr.
LGTM
5 years, 5 months ago (2015-07-15 22:18:42 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224363002/180001
5 years, 5 months ago (2015-07-15 23:32:10 UTC) #21
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 5 months ago (2015-07-15 23:40:51 UTC) #22
commit-bot: I haz the power
5 years, 5 months ago (2015-07-15 23:42:54 UTC) #23
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/4cf2aa39e2220a3b5ef50a95fc11cf4ff35a85d5
Cr-Commit-Position: refs/heads/master@{#338949}

Powered by Google App Engine
This is Rietveld 408576698