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

Issue 2907663004: FrameTree::Find only searches relative to local frames. (Closed)

Created:
3 years, 6 months ago by Łukasz Anforowicz
Modified:
3 years, 6 months ago
Reviewers:
dcheng, gene, alexmos, gene1
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, Peter Beverloo, nasko+codewatch_chromium.org, jam, dcheng, blink-reviews-api_chromium.org, mlamouri+watch-blink_chromium.org, dglazkov+blink, darin-cc_chromium.org, blink-reviews, blink-reviews-frames_chromium.org, kinuko+watch, jochen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

FrameTree::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... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -44 lines) Patch
M components/printing/test/print_web_view_helper_browsertest.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_plugin_instance_impl.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/render_view_browsertest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/shell/test_runner/test_runner_for_specific_view.cc View 1 2 3 4 5 6 1 chunk +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/Frame.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Frame.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/FrameTree.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/public/web/WebLocalFrame.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebView.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -9 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 55 (42 generated)
Łukasz Anforowicz
dcheng@, could you PTAL? This is a nice refactoring in itself, but I am mainly ...
3 years, 6 months ago (2017-05-26 16:38:40 UTC) #26
dcheng
https://codereview.chromium.org/2907663004/diff/100001/content/shell/test_runner/test_runner_for_specific_view.cc File content/shell/test_runner/test_runner_for_specific_view.cc (right): https://codereview.chromium.org/2907663004/diff/100001/content/shell/test_runner/test_runner_for_specific_view.cc#newcode682 content/shell/test_runner/test_runner_for_specific_view.cc:682: if (!web_view()->MainFrame()->IsWebLocalFrame()) Is this something we'll need to fix ...
3 years, 6 months ago (2017-05-26 18:28:06 UTC) #29
Łukasz Anforowicz
Thanks for the feedback Daniel - can you take another look please? https://codereview.chromium.org/2907663004/diff/100001/content/shell/test_runner/test_runner_for_specific_view.cc File content/shell/test_runner/test_runner_for_specific_view.cc ...
3 years, 6 months ago (2017-05-26 20:04:05 UTC) #30
dcheng
LGTM with comments addressed https://codereview.chromium.org/2907663004/diff/100001/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp File third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp (right): https://codereview.chromium.org/2907663004/diff/100001/third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp#newcode69 third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp:69: if (!web_view->MainFrame()->IsWebLocalFrame()) On 2017/05/26 20:04:05, ...
3 years, 6 months ago (2017-05-26 20:16:19 UTC) #31
Łukasz Anforowicz
Thanks. https://codereview.chromium.org/2907663004/diff/100001/third_party/WebKit/public/web/WebLocalFrame.h File third_party/WebKit/public/web/WebLocalFrame.h (right): https://codereview.chromium.org/2907663004/diff/100001/third_party/WebKit/public/web/WebLocalFrame.h#newcode115 third_party/WebKit/public/web/WebLocalFrame.h:115: // browsing instance containing this frame, looking for ...
3 years, 6 months ago (2017-05-26 20:51:20 UTC) #34
Łukasz Anforowicz
+alexmos@ for owners review of //content +gene@ for owners review of //components/printing
3 years, 6 months ago (2017-05-26 20:59:02 UTC) #36
alexmos
content/ LGTM
3 years, 6 months ago (2017-05-26 22:39:53 UTC) #37
gene1
/printing/ LGTM
3 years, 6 months ago (2017-05-31 20:26:54 UTC) #44
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/2907663004/170001
3 years, 6 months ago (2017-05-31 20:29:15 UTC) #47
commit-bot: I haz the power
Committed patchset #10 (id:170001) as https://chromium.googlesource.com/chromium/src/+/2fbbe131dc69bab2acc38c7289999cdd5e5716c8
3 years, 6 months ago (2017-05-31 21:01:26 UTC) #52
findit-for-me
Findit (https://goo.gl/kROfz5) identified this CL at revision 476020 as the culprit for failures in the ...
3 years, 6 months ago (2017-05-31 22:24:27 UTC) #53
Łukasz Anforowicz
On 2017/05/31 22:24:27, findit-for-me wrote: > Findit (https://goo.gl/kROfz5) identified this CL at revision 476020 as ...
3 years, 6 months ago (2017-05-31 22:36:36 UTC) #54
Łukasz Anforowicz
3 years, 6 months ago (2017-05-31 22:40:28 UTC) #55
Message was sent while issue was closed.
On 2017/05/31 22:36:36, Łukasz A. wrote:
> On 2017/05/31 22:24:27, findit-for-me wrote:
> > Findit (https://goo.gl/kROfz5) identified this CL at revision 476020 as the
> > culprit for
> > failures in the build cycles as shown on:
> >
>
https://findit-for-me.appspot.com/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3Itb...
> 
> I am still investigating, but I can repro the failures in
> WebUIResourceBrowserTest.MediaInternals* tests before this CL (i.e. at
> a708b081adfe).

https://crbug.com/728396 tracks the findit's bug.

Powered by Google App Engine
This is Rietveld 408576698