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

Issue 2849603005: Do not reinvent the wheel / use content APIs to find a frame by name. (Closed)

Created:
3 years, 7 months ago by Łukasz Anforowicz
Modified:
3 years, 7 months ago
Reviewers:
ncarter (slow), sky
CC:
chromium-reviews, jam, subresource-filter-reviews_chromium.org, rouslan+autofill_chromium.org, rogerm+autofillwatch_chromium.org, sebsg+autofillwatch_chromium.org, browser-components-watch_chromium.org, dcheng, mathp+autofillwatch_chromium.org, darin-cc_chromium.org, tfarina, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org, Avi (use Gerrit)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not reinvent the wheel / use content APIs to find a frame by name. This CL rewrites code that manually iterates over frames of WebContents to find a frame with a matching RenderFrameHost::GetFrameName. Tests above //content are rewritten to use content::FrameMatchingPredicate from content/public/test/browser_test_utils.h (instead of manually iterating over the frames and manually looking at RenderFrameHost::GetFrameName). //content code is rewritten to use content::FrameTree::FindByName. This CL has no intended behavior change (except changing messages in gtest assertions that verify that exactly 1 frame matches). BUG= Review-Url: https://codereview.chromium.org/2849603005 Cr-Commit-Position: refs/heads/master@{#468994} Committed: https://chromium.googlesource.com/chromium/src/+/424c0450bb5edc552aa13da3b8e7a9176cba70fc

Patch Set 1 #

Total comments: 7

Patch Set 2 : Fix null dereference in WebUIImpl::TargetFrame #

Total comments: 1

Patch Set 3 : Reverting changes in content_subresource_filter_driver_factory_unittest.cc #

Total comments: 4

Patch Set 4 : s/DCHECK_EQ/EXPECT_EQ/g #

Total comments: 4

Patch Set 5 : Making the return statement in FrameMatchingPredicate safe against null dereferencing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -50 lines) Patch
M chrome/browser/autofill/autofill_interactive_uitest.cc View 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/browser/subresource_filter/subresource_filter_browsertest.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc View 1 chunk +2 lines, -15 lines 0 comments Download
M content/browser/webui/web_ui_impl.h View 1 chunk +0 lines, -5 lines 0 comments Download
M content/browser/webui/web_ui_impl.cc View 1 2 chunks +9 lines, -18 lines 0 comments Download
M content/public/test/browser_test_utils.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 53 (31 generated)
Łukasz Anforowicz
nick@, can you PTAL? https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc File chrome/browser/autofill/autofill_interactive_uitest.cc (right): https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc#newcode219 chrome/browser/autofill/autofill_interactive_uitest.cc:219: web_contents, base::Bind(&content::FrameMatchesName, name)); Given how ...
3 years, 7 months ago (2017-04-27 21:36:32 UTC) #5
Łukasz Anforowicz
+avi@, since he added FrameMatchingPredicate, FrameMatchesName, FrameIsChildOfMainFrame, FrameHasSourceUrl in content/public/test/browser_test_utils.h
3 years, 7 months ago (2017-04-27 21:37:26 UTC) #6
Łukasz Anforowicz
Oh, and a clarification - this came up, because I need to find a frame ...
3 years, 7 months ago (2017-04-27 21:41:31 UTC) #7
ncarter (slow)
https://codereview.chromium.org/2849603005/diff/1/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc File chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc (right): https://codereview.chromium.org/2849603005/diff/1/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc#newcode706 chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc:706: web_contents(), base::Bind(&content::FrameMatchesName, name_to_find)); You've removed some ADD_FAILURES here, but ...
3 years, 7 months ago (2017-04-27 22:03:42 UTC) #8
Łukasz Anforowicz
https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc File chrome/browser/autofill/autofill_interactive_uitest.cc (right): https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc#newcode219 chrome/browser/autofill/autofill_interactive_uitest.cc:219: web_contents, base::Bind(&content::FrameMatchesName, name)); On 2017/04/27 21:36:32, Łukasz A. wrote: ...
3 years, 7 months ago (2017-04-27 22:59:29 UTC) #11
ncarter (slow)
https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc File chrome/browser/autofill/autofill_interactive_uitest.cc (right): https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc#newcode219 chrome/browser/autofill/autofill_interactive_uitest.cc:219: web_contents, base::Bind(&content::FrameMatchesName, name)); On 2017/04/27 21:36:32, Łukasz A. wrote: ...
3 years, 7 months ago (2017-04-27 23:13:35 UTC) #13
Łukasz Anforowicz
On 2017/04/27 23:13:35, ncarter wrote: > https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc > File chrome/browser/autofill/autofill_interactive_uitest.cc (right): > > https://codereview.chromium.org/2849603005/diff/1/chrome/browser/autofill/autofill_interactive_uitest.cc#newcode219 > ...
3 years, 7 months ago (2017-04-27 23:21:35 UTC) #14
ncarter (slow)
This lgtm. I'd approve adding this to web_contents.h too, but I agree that it's right ...
3 years, 7 months ago (2017-04-28 20:26:17 UTC) #20
Łukasz Anforowicz
On 2017/04/28 20:26:17, ncarter wrote: > This lgtm. Ok, thanks. I still see a red ...
3 years, 7 months ago (2017-04-28 22:18:58 UTC) #23
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/2849603005/40001
3 years, 7 months ago (2017-04-28 22:20:31 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/423767)
3 years, 7 months ago (2017-04-28 22:32:14 UTC) #27
Łukasz Anforowicz
sky@ can you PTAL? https://codereview.chromium.org/2849603005/diff/40001/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc File chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc (left): https://codereview.chromium.org/2849603005/diff/40001/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc#oldcode710 chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc:710: << "'" << name_to_find << ...
3 years, 7 months ago (2017-04-28 22:52:09 UTC) #29
sky
https://codereview.chromium.org/2849603005/diff/40001/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc File chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc (left): https://codereview.chromium.org/2849603005/diff/40001/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc#oldcode710 chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc:710: << "'" << name_to_find << "'"; On 2017/04/28 22:52:09, ...
3 years, 7 months ago (2017-05-01 16:50:30 UTC) #30
Łukasz Anforowicz
Thanks for the feedback sky@ - can you take another look please? https://codereview.chromium.org/2849603005/diff/40001/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc File chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc ...
3 years, 7 months ago (2017-05-01 18:11:29 UTC) #35
sky
https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc File content/public/test/browser_test_utils.cc (right): https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc#newcode938 content/public/test/browser_test_utils.cc:938: EXPECT_EQ(1U, frame_set.size()); One comment here. This should really be ...
3 years, 7 months ago (2017-05-01 21:14:09 UTC) #38
Łukasz Anforowicz
https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc File content/public/test/browser_test_utils.cc (right): https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc#newcode938 content/public/test/browser_test_utils.cc:938: EXPECT_EQ(1U, frame_set.size()); On 2017/05/01 21:14:09, sky wrote: > One ...
3 years, 7 months ago (2017-05-01 21:42:31 UTC) #39
sky
https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc File content/public/test/browser_test_utils.cc (right): https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc#newcode938 content/public/test/browser_test_utils.cc:938: EXPECT_EQ(1U, frame_set.size()); On 2017/05/01 21:42:31, Łukasz A. wrote: > ...
3 years, 7 months ago (2017-05-01 23:33:33 UTC) #40
Łukasz Anforowicz
https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc File content/public/test/browser_test_utils.cc (right): https://codereview.chromium.org/2849603005/diff/60001/content/public/test/browser_test_utils.cc#newcode938 content/public/test/browser_test_utils.cc:938: EXPECT_EQ(1U, frame_set.size()); On 2017/05/01 23:33:33, sky wrote: > On ...
3 years, 7 months ago (2017-05-02 19:55:48 UTC) #43
sky
LGTM
3 years, 7 months ago (2017-05-03 15:28:06 UTC) #46
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/2849603005/80001
3 years, 7 months ago (2017-05-03 16:02:31 UTC) #49
Łukasz Anforowicz
On 2017/05/03 15:28:06, sky wrote: > LGTM Thanks for reviewing!
3 years, 7 months ago (2017-05-03 16:02:38 UTC) #50
commit-bot: I haz the power
3 years, 7 months ago (2017-05-03 16:08:40 UTC) #53
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/424c0450bb5edc552aa13da3b8e7...

Powered by Google App Engine
This is Rietveld 408576698