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

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: Minor cleanup. Created 7 years 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.h
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 6ac984cb6b6d6926d85a6e584f11fd57d76463d9..f0bda4ae1f28747e42b0b3c5d942ac87ad2d989b 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -46,8 +46,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(
@@ -55,6 +64,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_; }
@@ -66,6 +79,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);
nasko 2013/12/20 22:59:51 nit: Since this is not in the public interface, it
Charlie Reis 2013/12/21 00:26:42 No, only one-liners that can be inlined should be
+
#if defined(ENABLE_PLUGINS)
// Notification that a PPAPI plugin has been created.
void PepperPluginCreated(RendererPpapiHost* host);
@@ -325,6 +342,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.
nasko 2013/12/20 22:59:51 nit: I think when we remove the flag requirement f
Charlie Reis 2013/12/21 00:26:42 Good thought, but let's remove the comment when th
+ // NULL otherwise.
+ blink::WebFrame* frame_;
+
RenderViewImpl* render_view_;
int routing_id_;
bool is_swapped_out_;

Powered by Google App Engine
This is Rietveld 408576698