DescriptionHandle 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 #Dependent Patchsets: Messages
Total messages: 11 (3 generated)
|