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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2797383002: Introduce RenderFrameVisitor (Closed)
Patch Set: Use the correct copyright notice 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
« no previous file with comments | « content/public/renderer/render_frame_visitor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index f67f5c53fe22700e41cf783b81aad5be84e4d395..334cdbae23ed6bdebd46b145e896f50eaf807c91 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -90,6 +90,7 @@
#include "content/public/renderer/document_state.h"
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_frame_observer.h"
+#include "content/public/renderer/render_frame_visitor.h"
#include "content/public/renderer/renderer_ppapi_host.h"
#include "content/renderer/accessibility/render_accessibility_impl.h"
#include "content/renderer/browser_plugin/browser_plugin.h"
@@ -1051,6 +1052,15 @@ RenderFrame* RenderFrame::FromWebFrame(blink::WebFrame* web_frame) {
}
// static
+void RenderFrame::ForEach(RenderFrameVisitor* visitor) {
+ FrameMap* frames = g_frame_map.Pointer();
+ for (FrameMap::iterator it = frames->begin(); it != frames->end(); ++it) {
+ if (!visitor->Visit(it->second))
+ return;
+ }
+}
+
+// static
RenderFrameImpl* RenderFrameImpl::FromWebFrame(blink::WebFrame* web_frame) {
FrameMap::iterator iter = g_frame_map.Get().find(web_frame);
if (iter != g_frame_map.Get().end())
« no previous file with comments | « content/public/renderer/render_frame_visitor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698