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

Unified Diff: chrome/browser/subresource_filter/subresource_filter_browsertest.cc

Issue 2849603005: Do not reinvent the wheel / use content APIs to find a frame by name. (Closed)
Patch Set: Making the return statement in FrameMatchingPredicate safe against null dereferencing. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/subresource_filter/subresource_filter_browsertest.cc
diff --git a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
index 273ad8bab8a3fd3986f54237ae7ae96fc3d4ae1c..aa75c2696b87bda69b5982e18f4cc231aac22ac5 100644
--- a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
@@ -315,11 +315,8 @@ class SubresourceFilterBrowserTestImpl : public InProcessBrowserTest {
}
content::RenderFrameHost* FindFrameByName(const std::string& name) {
- for (content::RenderFrameHost* frame : web_contents()->GetAllFrames()) {
- if (frame->GetFrameName() == name)
- return frame;
- }
- return nullptr;
+ return content::FrameMatchingPredicate(
+ web_contents(), base::Bind(&content::FrameMatchesName, name));
}
bool WasParsedScriptElementLoaded(content::RenderFrameHost* rfh) {
« no previous file with comments | « chrome/browser/autofill/autofill_interactive_uitest.cc ('k') | chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698