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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2797383002: Introduce RenderFrameVisitor (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: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 4b25c97a1395c02efaa633f8b1ff34ff6d6eb48f..8c797b53859e3ea3d827edaececaf9c4f658986b 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())

Powered by Google App Engine
This is Rietveld 408576698