Chromium Code Reviews
DescriptionFrameTree::Find only searches relative to local frames.
This CL reinforces that FrameTree::Find should only ever need to search
relative to *local* frames. To accomplish this, this CL:
- Adds a DCHECK(this_frame_->IsLocalFrame()) to FrameTree::Find method.
- Moves FindFrameForNavigation method from Frame to LocalFrame class.
- Moves FindFrameByName method from WebView to WebLocalFrame
and uses |this| rather than an optional |relative_to_frame| parameter.
All the existing callers of FrameTree::Find are already doing the lookup
relative to *local* frames, except test code. This CL preserves the old
behavior in the test code, by 1) doing the lookup relative to the main
frame and 2) failing safely if the main frame is remote or if the result
is not local (both 1 and 2 were the old behaviors of
WebView::FindFrameByName).
The move of the FindFrameByName method (including tweaks of the doc
comment) also highlights that the lookup (as implemented via
FrameTree::Find) should only search within a browsing instance, not just
within the frame tree of a given WebView. OTOH, this comes with some
disclaimers: 1) until https://crbug.com/718489 is fixed the lookup is
process-wide, and 2) some extension features require ignoring the
browsing instance boundaries.
BUG=718489
TBR=gene@chromium.org (got lgtm via gene1...)
Review-Url: https://codereview.chromium.org/2907663004
Cr-Commit-Position: refs/heads/master@{#476020}
Committed: https://chromium.googlesource.com/chromium/src/+/2fbbe131dc69bab2acc38c7289999cdd5e5716c8
Patch Set 1 #Patch Set 2 : Rebasing... #Patch Set 3 : . #Patch Set 4 : . #Patch Set 5 : Also move FindFrameByName from WebView to WebLocalFrame #Patch Set 6 : . #
Total comments: 15
Patch Set 7 : Addressed CR feedback #
Total comments: 2
Patch Set 8 : Rebasing... #Patch Set 9 : Addressed 2nd round of CR feedback #Patch Set 10 : Rebasing... #Dependent Patchsets: Messages
Total messages: 55 (42 generated)
|