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

Issue 1046933005: Refactor postMessage for out-of-process iframes. (Closed)

Created:
5 years, 8 months ago by alexmos
Modified:
5 years, 8 months ago
Reviewers:
kenrb, Charlie Reis, jam
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-renderer_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

Refactor postMessage for out-of-process iframes. This CL moves cross-process postMessage plumbing from RenderView to RenderFrame: - The renderer-to-browser RouteMessageEvent message is now sent through RenderFrameProxy rather than a swapped-out RenderView. - The bulk of WebContentsImpl::RouteMessageEvent is moved into RenderFrameProxyHost::RouteMessageEvent. Unfortunately, we still need to call up to WebContents for dealing with <webview> and on-demand creation of swapped-out RVs for the opener chain. This will be cleaned up as part of https://crbug.com/225940. - the browser-to-renderer PostMessageEvent message is now handled in RenderFrameImpl::OnPostMessageEvent, instead of RenderViewImpl. These changes make it possible to send messages between cross-process subframes when in --site-per-process mode. This is exercised in a new test, SitePerProcessBrowserTest.SubframePostMessage. More work will be needed to support postMessages involving subframes in cross-process openers (see https://crbug.com/225940 and https://crbug.com/423587). With this change, the RFHM::SupportCrossProcessPostMessage test now works in --site-per-process mode, so it is enabled on the Site Isolation FYI bots. BUG=389721 TBR=jam@chromium.org Committed: https://crrev.com/e7da5a1508504fded712749adc154a69424afa9e Cr-Commit-Position: refs/heads/master@{#324341}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Fix MimeHandlerViewTest.Iframe (no proxy when source is a subframe in cross-process window) #

Patch Set 4 : Add legacy support for sending postMessages to Android WebView #

Patch Set 5 : Misc cleanup #

Patch Set 6 : Enable SupportCrossProcessPostMessage test on FYI bots #

Total comments: 9

Patch Set 7 : Rebase #

Patch Set 8 : Update test comment #

Patch Set 9 : Rebase #

Total comments: 4

Patch Set 10 : Charlie's comments; moving set_render_frame_proxy() up in OnSwapOut #

Total comments: 14

Patch Set 11 : Charlie's nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+435 lines, -220 lines) Patch
M content/browser/frame_host/render_frame_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +21 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_delegate.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.cc View 1 2 3 4 5 6 7 8 9 3 chunks +84 lines, -0 lines 0 comments Download
M content/browser/message_port_message_filter.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/message_port_message_filter.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M content/browser/message_port_provider.cc View 1 2 3 3 chunks +9 lines, -4 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 +0 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -7 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +85 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -3 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -58 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +40 lines, -0 lines 0 comments Download
M content/common/swapped_out_messages.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 3 chunks +0 lines, -32 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 9 chunks +97 lines, -24 lines 0 comments Download
M content/renderer/render_frame_proxy.h View 2 chunks +6 lines, -6 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 2 3 2 chunks +7 lines, -6 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 2 chunks +0 lines, -2 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 6 chunks +0 lines, -61 lines 0 comments Download
A content/test/data/frame_tree/page_with_post_message_frames.html View 1 chunk +20 lines, -0 lines 0 comments Download
M content/test/data/post_message.html View 2 chunks +17 lines, -0 lines 0 comments Download
M testing/buildbot/chromium.fyi.json View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (5 generated)
alexmos
Charlie, could you please take a look? Also some comments below. Sorry about this being ...
5 years, 8 months ago (2015-04-02 23:17:00 UTC) #2
Charlie Reis
Nice job working through the issues here. It'll be so nice to remove swappedout:// and ...
5 years, 8 months ago (2015-04-06 16:18:56 UTC) #3
alexmos
https://codereview.chromium.org/1046933005/diff/100001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1046933005/diff/100001/content/renderer/render_frame_impl.cc#newcode3553 content/renderer/render_frame_impl.cc:3553: CHECK(render_frame_proxy_); On 2015/04/06 16:18:55, Charlie Reis wrote: > On ...
5 years, 8 months ago (2015-04-07 18:44:40 UTC) #4
Charlie Reis
Great. LGTM with nits. https://codereview.chromium.org/1046933005/diff/180001/content/browser/frame_host/render_frame_host_delegate.h File content/browser/frame_host/render_frame_host_delegate.h (right): https://codereview.chromium.org/1046933005/diff/180001/content/browser/frame_host/render_frame_host_delegate.h#newcode173 content/browser/frame_host/render_frame_host_delegate.h:173: // |target_rfh| from a source ...
5 years, 8 months ago (2015-04-07 21:14:32 UTC) #5
alexmos
Thanks! Ken, do you mind doing an IPC owner review for this? https://codereview.chromium.org/1046933005/diff/180001/content/browser/frame_host/render_frame_host_delegate.h File content/browser/frame_host/render_frame_host_delegate.h ...
5 years, 8 months ago (2015-04-07 21:47:31 UTC) #7
kenrb
ipc lgtm
5 years, 8 months ago (2015-04-08 20:11:46 UTC) #8
alexmos
Thanks, TBR'ing jam@ for testing/buildbot/chromium.fyi.json (to re-enable the SupportCrossProcessPostMessage test on site isolation FYI bots).
5 years, 8 months ago (2015-04-08 20:41:10 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1046933005/200001
5 years, 8 months ago (2015-04-08 20:43:11 UTC) #13
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 8 months ago (2015-04-09 02:22:29 UTC) #14
commit-bot: I haz the power
5 years, 8 months ago (2015-04-09 02:23:32 UTC) #15
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/e7da5a1508504fded712749adc154a69424afa9e
Cr-Commit-Position: refs/heads/master@{#324341}

Powered by Google App Engine
This is Rietveld 408576698