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

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: 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 9aa2ddb77d7944964cc57c1930c8df379610699c..5fe80ab025cd119a7f89bb04c200feff3d12143b 100644
--- a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
@@ -312,11 +312,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) {

Powered by Google App Engine
This is Rietveld 408576698