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

Issue 1309043003: Handle frame openers in the same FrameTree when navigating subframes. (Closed)

Created:
5 years, 4 months ago by alexmos
Modified:
5 years, 3 months ago
Reviewers:
Charlie Reis
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, lfg
Base URL:
https://chromium.googlesource.com/chromium/src.git@opener-cycle-detection
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Handle frame openers in the same FrameTree when navigating subframes. When a frame navigates to a new SiteInstance, CreateOpenerProxiesIfNeeded is called to create proxies for the frame's opener chain in the new SiteInstance. Currently, CreateOpenerProxiesIfNeeded simply invokes CreateOpenerProxies on the frame's opener. This works correctly for top-level frames, but it doesn't work for subframes. For example, suppose a top-level frame A has an opener X and a subframe that navigates to B. With today's approach, X won't get a proxy in process B, since CreateOpenerProxiesIfNeeded only tries to follow the subframe's opener (which is null). This is wrong, because the subframe can access X with window.parent.opener. Instead, when CreateOpenerProxiesIfNeeded is called on a subframe, it needs to follow openers of other nodes of the same FrameTree as well, not just the current node. This CL fixes this. The proxy creation logic when navigating a FTN to a new SiteInstance does two things: 1. Call CreateOpenerProxiesIfNeeded, which just calls CreateOpenerProxies on the current node's opener. (Only done when navigating to a related SiteInstance.) 2. Call CreateProxiesForSiteInstance to create proxies for all nodes in the current FrameTree, skipping over the node that's navigating. This CL changes (1) to directly call CreateOpenerProxies, which already handles openers for all nodes in the same FrameTree. Additional plumbing is added to ensure we don't try to create proxies in the node that's being navigated. Because CreateOpenerProxies starts from the FrameTree of the current node and not from the tree of its opener, this means that essentially, (2) is now done as part of (1) (when the node is navigating to a related SiteInstance). BUG=225940 Committed: https://crrev.com/90325cfabf9c0932eb13b4ed9ace2e3940540f89 Cr-Commit-Position: refs/heads/master@{#346949}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Rebase #

Patch Set 4 : Tweak approach to fix tests #

Patch Set 5 : Bug fix #

Patch Set 6 : Cleanup #

Total comments: 23

Patch Set 7 : Resolve conflict with Daniel's CL #

Patch Set 8 : Charlie's comments #

Patch Set 9 : Add comment for the DCHECK #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -76 lines) Patch
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_manager.h View 1 2 3 4 5 6 3 chunks +14 lines, -14 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager.cc View 1 2 3 4 5 6 7 8 8 chunks +59 lines, -58 lines 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +51 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/browser/web_contents/web_contents_impl_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/test/data/post_message.html View 1 chunk +6 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 11 (3 generated)
alexmos
Charlie, what do you think about this general approach? Although the problem looks pretty simple, ...
5 years, 3 months ago (2015-08-25 22:38:08 UTC) #2
Charlie Reis
This seems reasonable to me. A few minor comments and replies below. https://codereview.chromium.org/1309043003/diff/100001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc ...
5 years, 3 months ago (2015-08-31 20:49:44 UTC) #3
alexmos
Thanks for reviewing! https://codereview.chromium.org/1309043003/diff/100001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://codereview.chromium.org/1309043003/diff/100001/content/browser/frame_host/render_frame_host_manager.cc#newcode417 content/browser/frame_host/render_frame_host_manager.cc:417: CreateOpenerProxies(dest_render_frame_host->GetSiteInstance(), On 2015/08/31 20:49:43, Charlie Reis ...
5 years, 3 months ago (2015-09-01 22:12:28 UTC) #4
Charlie Reis
[+lfg to CC, since this might slightly conflict with https://codereview.chromium.org/1306053008/, though I don't think it ...
5 years, 3 months ago (2015-09-01 23:37:26 UTC) #5
alexmos
https://codereview.chromium.org/1309043003/diff/100001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://codereview.chromium.org/1309043003/diff/100001/content/browser/frame_host/render_frame_host_manager.cc#newcode2520 content/browser/frame_host/render_frame_host_manager.cc:2520: DCHECK(frame_tree_node_->IsMainFrame()); On 2015/09/01 23:37:26, Charlie Reis (OOO till 9-8) ...
5 years, 3 months ago (2015-09-02 00:02:11 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309043003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309043003/160001
5 years, 3 months ago (2015-09-02 17:13:04 UTC) #9
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 3 months ago (2015-09-02 17:18:49 UTC) #10
commit-bot: I haz the power
5 years, 3 months ago (2015-09-02 17:19:39 UTC) #11
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/90325cfabf9c0932eb13b4ed9ace2e3940540f89
Cr-Commit-Position: refs/heads/master@{#346949}

Powered by Google App Engine
This is Rietveld 408576698