Index: content/browser/frame_host/render_frame_proxy_host.h |
diff --git a/content/browser/frame_host/render_frame_proxy_host.h b/content/browser/frame_host/render_frame_proxy_host.h |
index 514f0b22c41d1c3edb13d914aa117f96a529069f..3a8b487a32b528d05fa804d11af196c3d5cc46f7 100644 |
--- a/content/browser/frame_host/render_frame_proxy_host.h |
+++ b/content/browser/frame_host/render_frame_proxy_host.h |
@@ -8,7 +8,10 @@ |
#include "base/memory/scoped_ptr.h" |
#include "content/browser/frame_host/render_frame_host_impl.h" |
#include "content/browser/site_instance_impl.h" |
+#include "ipc/ipc_listener.h" |
+#include "ipc/ipc_sender.h" |
+class FrameTreeNode; |
class RenderProcessHost; |
class RenderFrameHostImpl; |
class RenderViewHostImpl; |
@@ -47,35 +50,67 @@ namespace content { |
// forward. It also instructs the RenderFrameHost to run the unload event |
// handler and is kept alive for the duration. Once the event handling is |
// complete, the RenderFrameHost is deleted. |
-class RenderFrameProxyHost { |
+class RenderFrameProxyHost |
+ : public IPC::Listener, |
+ public IPC::Sender { |
public: |
- explicit RenderFrameProxyHost( |
- scoped_ptr<RenderFrameHostImpl> render_frame_host); |
- ~RenderFrameProxyHost(); |
+ RenderFrameProxyHost(SiteInstance* site_instance, |
+ FrameTreeNode* frame_tree_node); |
+ virtual ~RenderFrameProxyHost(); |
RenderProcessHost* GetProcess() { |
- return render_frame_host_->GetProcess(); |
+ return site_instance_->GetProcess(); |
+ } |
+ |
+ int GetRoutingID() { |
+ return routing_id_; |
} |
SiteInstance* GetSiteInstance() { |
return site_instance_.get(); |
} |
+ // This method deletes the RenderFrameProxy object in the renderer process, |
Charlie Reis
2014/05/15 00:32:50
nit: Remove comma
nasko
2014/05/15 18:47:13
Done.
|
+ // which corresponds to this RenderFrameProxyHost. Must be called before |
Charlie Reis
2014/05/15 00:32:50
I'm a bit concerned about missing cases where the
nasko
2014/05/15 18:47:13
In the case of a renderer process crashing, we del
|
+ // deleting the RenderFrameProxyHost if the renderer process exists and is |
+ // responsive. |
+ void DeleteRendererProxy(); |
Charlie Reis
2014/05/15 00:32:50
nit: DeleteRenderFrameProxy()
nasko
2014/05/15 18:47:13
Done.
|
+ |
// TODO(nasko): The following methods should be removed when swapping out |
// of RenderFrameHosts is no longer used. |
RenderFrameHostImpl* render_frame_host() { |
return render_frame_host_.get(); |
} |
RenderViewHostImpl* render_view_host() { |
Charlie Reis
2014/05/15 00:32:50
This isn't a one liner anymore, so it should be in
nasko
2014/05/15 18:47:13
This is no longer needed.
|
- return render_frame_host_->render_view_host(); |
+ if (render_frame_host_.get()) |
+ return render_frame_host_->render_view_host(); |
+ return NULL; |
+ } |
+ void TakeFrameHostOwnership( |
+ scoped_ptr<RenderFrameHostImpl> render_frame_host) { |
+ render_frame_host_ = render_frame_host.Pass(); |
} |
- scoped_ptr<RenderFrameHostImpl> PassFrameHost() { |
+ scoped_ptr<RenderFrameHostImpl> PassFrameHostOwnership() { |
Charlie Reis
2014/05/15 00:32:50
nit: Move implementation to .cc file.
nasko
2014/05/15 18:47:13
Done.
|
+ DeleteRendererProxy(); |
return render_frame_host_.Pass(); |
} |
+ // IPC::Sender |
+ virtual bool Send(IPC::Message* msg) OVERRIDE; |
+ |
private: |
+ // IPC::Listener |
+ virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
+ |
+ // This RenderFrameProxyHost's routing id. |
+ int routing_id_; |
+ |
+ // The SiteInstance this proxy is associated with. |
scoped_refptr<SiteInstance> site_instance_; |
+ // The node in the frame tree where this proxy is located. |
+ FrameTreeNode* frame_tree_node_; |
+ |
// TODO(nasko): For now, hide the RenderFrameHost inside the proxy, but remove |
// it once we have all the code support for proper proxy objects. |
scoped_ptr<RenderFrameHostImpl> render_frame_host_; |