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

Unified Diff: content/renderer/render_frame_impl.h

Issue 109653014: Allow RenderFrames to swap out for subframe navigations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix an error during merge. Created 6 years, 12 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/common/swapped_out_messages.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.h
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 53fddbe0884e859d861ac036fe3be540f44a87c4..274c5970bd6a041669bd16ddd15c7b10e28b2af0 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -47,8 +47,17 @@ class CONTENT_EXPORT RenderFrameImpl
public:
// Creates a new RenderFrame. |render_view| is the RenderView object that this
// frame belongs to.
+ // Callers *must* call |SetWebFrame| immediately after creation.
+ // TODO(creis): We should structure this so that |SetWebFrame| isn't needed.
static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id);
+ // For subframes, look up the RenderFrameImpl for the given WebFrame. Returns
+ // NULL for main frames.
+ // This only works when using --site-per-process, and returns NULL otherwise.
+ // TODO(creis): Remove this when the RenderView methods dealing with frames
+ // have moved to RenderFrame.
+ static RenderFrameImpl* FindByWebFrame(blink::WebFrame* web_frame);
+
// Used by content_layouttest_support to hook into the creation of
// RenderFrameImpls.
static void InstallCreateHook(
@@ -56,6 +65,10 @@ class CONTENT_EXPORT RenderFrameImpl
virtual ~RenderFrameImpl();
+ bool is_swapped_out() const {
+ return is_swapped_out_;
+ }
+
// TODO(jam): this is a temporary getter until all the code is transitioned
// to using RenderFrame instead of RenderView.
RenderViewImpl* render_view() { return render_view_; }
@@ -69,6 +82,10 @@ class CONTENT_EXPORT RenderFrameImpl
// blink::WebFrame has been created.
void MainWebFrameCreated(blink::WebFrame* frame);
+ // In --site-per-process mode, we keep track of which WebFrame this
+ // RenderFrameImpl is for.
+ void SetWebFrame(blink::WebFrame* web_frame);
+
#if defined(ENABLE_PLUGINS)
// Notification that a PPAPI plugin has been created.
void PepperPluginCreated(RendererPpapiHost* host);
@@ -329,6 +346,16 @@ class CONTENT_EXPORT RenderFrameImpl
void AddObserver(RenderFrameObserver* observer);
void RemoveObserver(RenderFrameObserver* observer);
+ // IPC message handlers ------------------------------------------------------
+ //
+ // The documentation for these functions should be in
+ // content/common/*_messages.h for the message that the function is handling.
+ void OnSwapOut();
+
+ // In --site-per-process mode, stores the WebFrame we are associated with.
+ // NULL otherwise.
+ blink::WebFrame* frame_;
+
RenderViewImpl* render_view_;
int routing_id_;
bool is_swapped_out_;
« no previous file with comments | « content/common/swapped_out_messages.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698