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

Issue 2506183002: Make window.open() IPCs be frame-based (Closed)

Created:
4 years, 1 month ago by ncarter (slow)
Modified:
3 years, 11 months ago
CC:
chromium-reviews, darin (slow to review), dominickn+watch_chromium.org, creis+watch_chromium.org, qsr+mojo_chromium.org, mlamouri+watch-content_chromium.org, viettrungluu+watch_chromium.org, lcwu+watch_chromium.org, nasko+codewatch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, pkotwicz+watch_chromium.org, halliwell+watch_chromium.org, agrieve+watch_chromium.org, alokp+watch_chromium.org, zpeng+watch_chromium.org, android-webview-reviews_chromium.org, site-isolation-reviews_chromium.org, gone
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make window.open() IPCs be frame-based. - Two IPCs, CreateNewWindow and ShowCreatedWindow, are made to be routed via the opener frame. Previously they were routed via the opener view. - CreateNewWindow (which is mojofied) stays put but its parameters change - ViewHostMsg_ShowView becomes FrameHostMsg_ShowCreatedWindow - The corresponding delegate methods move from RenderViewHostDelegate to RenderFrameHostDelegate, though the implementation stays in WebContentsImpl, which implements both interfaces. - Remove the RenderView opener_id parameter from the mojo CreateNewWindow params, it can be inferred from the RenderFrame id. This fixes a possible bad situation where an unrelated RV/RF route id pair could be supplied. - The pending WebContents list is made to be indexed by the main frame widget; this turns out to be cleaner than making it frame- based, since show() is an operation on the created RenderWidget. - The signature of ContentBrowserClient::CanCreateWindow changes to be frame-based, which necessitates retooling the android SingleTabModeTabHelper to be frame-based also. - The ViewMsg_Close message, which cleans up after UI-thread failure of the CreateNewWindow operation, is hoisted out to the outermost function where failure is possible, RenderWidgetHelper::OnCreateNewWindowOnUI. This addresses some possible RenderView leaks when e.g. window.open() races a navigation that destroys the opener. These races would have become more likely now that we're routing via the frame, since child frames can have a shorter lifetime than their RenderViewHosts. - The response to ShowCreatedWindow on the opener RenderFrame is a ViewMsg_Move_ACK on the openee RenderWidget. This IPC moves to WebContentsImpl::ShowCreatedWindow so that it can be sent via the openee RenderWidgetHost's IPC::Sender, rather than via the opener RenderFrame. BUG=431769, 304341 TBR=alokp@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2506183002 Cr-Commit-Position: refs/heads/master@{#441781} Committed: https://chromium.googlesource.com/chromium/src/+/5ae4d2d504ad44943b99835f1eb7cba724318a97

Patch Set 1 #

Patch Set 2 : y #

Patch Set 3 : Cleanup. #

Patch Set 4 : Cleanup. #

Patch Set 5 : Fixes #

Patch Set 6 : Compile fix. #

Total comments: 56

Patch Set 7 : Alex's fixes. #

Patch Set 8 : Few more fixes #

Total comments: 3

Patch Set 9 : end #

Patch Set 10 : Remove frame_tree_node include & DEPS #

Total comments: 1

Patch Set 11 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+409 lines, -364 lines) Patch
M android_webview/browser/aw_content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -4 lines 0 comments Download
M android_webview/browser/aw_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/android/webapps/single_tab_mode_tab_helper.h View 1 2 chunks +2 lines, -7 lines 0 comments Download
M chrome/browser/android/webapps/single_tab_mode_tab_helper.cc View 1 2 3 4 5 2 chunks +28 lines, -27 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +14 lines, -21 lines 0 comments Download
M chromecast/browser/cast_content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +15 lines, -17 lines 0 comments Download
M chromecast/browser/cast_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -3 lines 0 comments Download
M content/browser/frame_host/interstitial_page_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -12 lines 0 comments Download
M content/browser/frame_host/interstitial_page_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -6 lines 0 comments Download
M content/browser/frame_host/render_frame_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +44 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +23 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +37 lines, -0 lines 0 comments Download
M content/browser/renderer_host/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -19 lines 0 comments Download
M content/browser/renderer_host/render_view_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +0 lines, -41 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +0 lines, -13 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +0 lines, -26 lines 0 comments Download
M content/browser/renderer_host/render_widget_helper.h View 1 2 chunks +7 lines, -7 lines 0 comments Download
M content/browser/renderer_host/render_widget_helper.cc View 1 2 3 4 5 6 7 8 9 4 chunks +36 lines, -17 lines 0 comments Download
M content/browser/security_exploit_browsertest.cc View 1 1 chunk +5 lines, -4 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +16 lines, -15 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +19 lines, -17 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +40 lines, -39 lines 0 comments Download
M content/browser/web_contents/web_contents_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +22 lines, -4 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -0 lines 0 comments Download
M content/common/render_message_filter.mojom View 1 2 3 4 5 4 chunks +7 lines, -7 lines 0 comments Download
M content/common/swapped_out_messages.cc View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -18 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -4 lines 0 comments Download
M content/public/browser/content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -3 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +18 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -5 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +6 lines, -20 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 77 (57 generated)
ncarter (slow)
Alex, this is finally ready for you.
4 years ago (2016-12-12 19:06:02 UTC) #31
Avi (use Gerrit)
drive-by https://codereview.chromium.org/2506183002/diff/100001/content/browser/frame_host/interstitial_page_impl.cc File content/browser/frame_host/interstitial_page_impl.cc (right): https://codereview.chromium.org/2506183002/diff/100001/content/browser/frame_host/interstitial_page_impl.cc#newcode770 content/browser/frame_host/interstitial_page_impl.cc:770: << "InterstitialPage does not support showing full screen ...
4 years ago (2016-12-12 19:17:05 UTC) #33
alexmos
Thanks so much for working on this - this is amazing! https://codereview.chromium.org/2506183002/diff/100001/content/browser/frame_host/interstitial_page_impl.h File content/browser/frame_host/interstitial_page_impl.h (right): ...
4 years ago (2016-12-13 18:41:41 UTC) #34
alexmos
Also, it'd be nice to reference a bug number for this. Looks like we've got ...
4 years ago (2016-12-13 18:46:22 UTC) #35
ncarter (slow)
ptal https://codereview.chromium.org/2506183002/diff/100001/content/browser/frame_host/interstitial_page_impl.cc File content/browser/frame_host/interstitial_page_impl.cc (right): https://codereview.chromium.org/2506183002/diff/100001/content/browser/frame_host/interstitial_page_impl.cc#newcode770 content/browser/frame_host/interstitial_page_impl.cc:770: << "InterstitialPage does not support showing full screen ...
4 years ago (2016-12-15 00:33:17 UTC) #41
ncarter (slow)
Note: I see the AttemptDuplicateRenderViewHost test failure, and am looking into it. It actually looks ...
4 years ago (2016-12-15 17:47:53 UTC) #45
alexmos
LGTM with one comment about removing frame_tree_node.h from render_widget_helper. I wonder if the test failure ...
4 years ago (2016-12-15 18:36:48 UTC) #46
ncarter (slow)
+nasko for IPC review
4 years ago (2016-12-15 21:41:21 UTC) #50
ncarter (slow)
sgurun@chromium.org: Please review changes in android_webview/ alokp@chromium.org: Please review changes in chromecast/ dominickn@chromium.org: Please review ...
4 years ago (2016-12-15 21:45:07 UTC) #52
ncarter (slow)
https://codereview.chromium.org/2506183002/diff/140001/content/browser/renderer_host/DEPS File content/browser/renderer_host/DEPS (right): https://codereview.chromium.org/2506183002/diff/140001/content/browser/renderer_host/DEPS#newcode42 content/browser/renderer_host/DEPS:42: "+content/browser/frame_host/frame_tree_node.h", On 2016/12/15 18:36:48, alexmos wrote: > This isn't ...
4 years ago (2016-12-15 22:22:17 UTC) #53
dominickn
chrome/browser/android/webapps lgtm. +cc dfalcantara FYI (original author of single_tab_mode_tab_helper)
4 years ago (2016-12-15 23:18:33 UTC) #54
nasko
IPC LGTM https://codereview.chromium.org/2506183002/diff/180001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2506183002/diff/180001/content/browser/web_contents/web_contents_impl.cc#newcode2235 content/browser/web_contents/web_contents_impl.cc:2235: user_gesture, NULL); nit: If you are touching ...
4 years ago (2016-12-15 23:30:17 UTC) #55
sgurun-gerrit only
On 2016/12/15 23:30:17, nasko wrote: > IPC LGTM > > https://codereview.chromium.org/2506183002/diff/180001/content/browser/web_contents/web_contents_impl.cc > File content/browser/web_contents/web_contents_impl.cc (right): ...
4 years ago (2016-12-17 02:48:35 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2506183002/180001
4 years ago (2016-12-19 23:26:15 UTC) #60
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/89178)
4 years ago (2016-12-20 00:46:52 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2506183002/180001
3 years, 11 months ago (2017-01-05 18:06:25 UTC) #64
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/130738) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 11 months ago (2017-01-05 18:09:13 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2506183002/200001
3 years, 11 months ago (2017-01-05 23:04:03 UTC) #73
alokp
lgtm
3 years, 11 months ago (2017-01-05 23:59:01 UTC) #74
commit-bot: I haz the power
3 years, 11 months ago (2017-01-06 01:19:14 UTC) #77
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/5ae4d2d504ad44943b99835f1eb7...

Powered by Google App Engine
This is Rietveld 408576698