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

Unified Diff: content/renderer/render_frame_proxy.h

Issue 404613005: Start using RenderFrameProxyHost objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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_proxy.h
diff --git a/content/renderer/render_frame_proxy.h b/content/renderer/render_frame_proxy.h
index 54c63619290485850f4598cfce1c5526fb4e0b41..360dc6db95ed8f835991ef9eeaaf6ba2338d8981 100644
--- a/content/renderer/render_frame_proxy.h
+++ b/content/renderer/render_frame_proxy.h
@@ -48,28 +48,56 @@ class CONTENT_EXPORT RenderFrameProxy
public IPC::Sender,
NON_EXPORTED_BASE(public blink::WebFrameClient) {
public:
+ // This method should be used to create a RenderFrameProxy, which will replace
+ // an existing RenderFrame during its cross-process navigation from the
+ // current process to a different one. |routing_id| will be ID of the newly
+ // created RenderFrameProxy. |frame_to_replace| is the frame that the new
+ // proxy will eventually swap places with.
+ static RenderFrameProxy* CreateProxyToReplaceFrame(
+ RenderFrameImpl* frame_to_replace,
+ int routing_id);
+
+ // This method should be used to create a RenderFrameProxy, when there isn't
+ // an existing RenderFrame. It should be called to construct a local
+ // representation of a RenderFrame that has been created in another process --
+ // for example, after a cross-process navigation or after the addition of a
+ // new frame local to some other process. |routing_id| will be the ID of the
+ // newly created RenderFrameProxy. |parent_routing_id| is the routing ID of
+ // the RenderFrameProxy to which the new frame is parented.
+ // |render_view_routing_id| identifies the RenderView to be associated with
+ // this frame.
+ //
+ // |parent_routing_id| always identifies a RenderFrameProxy (never a
+ // RenderFrame) because a new child of a local frame should always start out
+ // as a frame, not a proxy.
static RenderFrameProxy* CreateFrameProxy(int routing_id,
- int frame_routing_id);
+ int parent_routing_id,
+ int render_view_routing_id);
// Returns the RenderFrameProxy for the given routing ID.
static RenderFrameProxy* FromRoutingID(int routing_id);
+ // Returns the RenderFrameProxy given a WebFrame.
+ static RenderFrameProxy* FromWebFrame(blink::WebFrame* web_frame);
+
virtual ~RenderFrameProxy();
// IPC::Sender
virtual bool Send(IPC::Message* msg) OVERRIDE;
- RenderFrameImpl* render_frame() {
- return render_frame_;
- }
-
// Out-of-process child frames receive a signal from RenderWidgetCompositor
// when a compositor frame has committed.
void DidCommitCompositorFrame();
+ int routing_id() { return routing_id_; }
+ RenderViewImpl* render_view() { return render_view_; }
+ blink::WebRemoteFrame* web_frame() { return web_frame_; }
+
private:
RenderFrameProxy(int routing_id, int frame_routing_id);
+ void Init(blink::WebRemoteFrame* frame, RenderViewImpl* render_view);
+
// IPC::Listener
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
@@ -79,14 +107,19 @@ class CONTENT_EXPORT RenderFrameProxy
void OnBuffersSwapped(const FrameMsg_BuffersSwapped_Params& params);
void OnCompositorFrameSwapped(const IPC::Message& message);
- blink::WebFrame* GetWebFrame();
+ // The routing ID by which this RenderFrameProxy is known.
+ const int routing_id_;
- int routing_id_;
- int frame_routing_id_;
- RenderFrameImpl* render_frame_;
+ // The routing ID of the local RenderFrame (if any) which this
+ // RenderFrameProxy is meant to replace in the frame tree.
+ const int frame_routing_id_;
+ // Stores the WebRemoteFrame we are associated with.
+ blink::WebRemoteFrame* web_frame_;
scoped_refptr<ChildFrameCompositingHelper> compositing_helper_;
+ RenderViewImpl* render_view_;
+
DISALLOW_COPY_AND_ASSIGN(RenderFrameProxy);
};

Powered by Google App Engine
This is Rietveld 408576698