| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 10 #include "content/browser/site_instance_impl.h" | 10 #include "content/browser/site_instance_impl.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // * When navigating cross-process and the existing document has an unload | 48 // * When navigating cross-process and the existing document has an unload |
| 49 // event handler. When the new navigation commits, RenderFrameHostManager | 49 // event handler. When the new navigation commits, RenderFrameHostManager |
| 50 // creates a RenderFrameProxyHost for the old SiteInstance and uses it going | 50 // creates a RenderFrameProxyHost for the old SiteInstance and uses it going |
| 51 // forward. It also instructs the RenderFrameHost to run the unload event | 51 // forward. It also instructs the RenderFrameHost to run the unload event |
| 52 // handler and is kept alive for the duration. Once the event handling is | 52 // handler and is kept alive for the duration. Once the event handling is |
| 53 // complete, the RenderFrameHost is deleted. | 53 // complete, the RenderFrameHost is deleted. |
| 54 class RenderFrameProxyHost | 54 class RenderFrameProxyHost |
| 55 : public IPC::Listener, | 55 : public IPC::Listener, |
| 56 public IPC::Sender { | 56 public IPC::Sender { |
| 57 public: | 57 public: |
| 58 static RenderFrameProxyHost* FromID(int process_id, int routing_id); | |
| 59 | |
| 60 RenderFrameProxyHost(SiteInstance* site_instance, | 58 RenderFrameProxyHost(SiteInstance* site_instance, |
| 61 FrameTreeNode* frame_tree_node); | 59 FrameTreeNode* frame_tree_node); |
| 62 virtual ~RenderFrameProxyHost(); | 60 virtual ~RenderFrameProxyHost(); |
| 63 | 61 |
| 64 RenderProcessHost* GetProcess() { | 62 RenderProcessHost* GetProcess() { |
| 65 return site_instance_->GetProcess(); | 63 return site_instance_->GetProcess(); |
| 66 } | 64 } |
| 67 | 65 |
| 68 // Initializes the object and creates the RenderFrameProxy in the process | 66 // Initializes the object and creates the RenderFrameProxy in the process |
| 69 // for the SiteInstance. | 67 // for the SiteInstance. |
| 70 bool InitRenderFrameProxy(); | 68 bool InitRenderFrameProxy(); |
| 71 | 69 |
| 72 int GetRoutingID() { | 70 int GetRoutingID() { |
| 73 return routing_id_; | 71 return routing_id_; |
| 74 } | 72 } |
| 75 | 73 |
| 76 SiteInstance* GetSiteInstance() { | 74 SiteInstance* GetSiteInstance() { |
| 77 return site_instance_.get(); | 75 return site_instance_.get(); |
| 78 } | 76 } |
| 79 | 77 |
| 80 FrameTreeNode* frame_tree_node() const { return frame_tree_node_; }; | |
| 81 | |
| 82 void SetChildRWHView(RenderWidgetHostView* view); | 78 void SetChildRWHView(RenderWidgetHostView* view); |
| 83 | 79 |
| 84 // TODO(nasko): The following methods should be removed once we don't have a | 80 // TODO(nasko): The following methods should be removed once we don't have a |
| 85 // swapped out state on RenderFrameHosts. See https://crbug.com/357747. | 81 // swapped out state on RenderFrameHosts. See https://crbug.com/357747. |
| 86 RenderFrameHostImpl* render_frame_host() { | 82 RenderFrameHostImpl* render_frame_host() { |
| 87 return render_frame_host_.get(); | 83 return render_frame_host_.get(); |
| 88 } | 84 } |
| 89 RenderViewHostImpl* GetRenderViewHost(); | 85 RenderViewHostImpl* GetRenderViewHost(); |
| 90 | 86 |
| 91 void TakeFrameHostOwnership( | 87 void TakeFrameHostOwnership( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // TODO(nasko): This can be removed once we don't have a swapped out state on | 123 // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 128 // RenderFrameHosts. See https://crbug.com/357747. | 124 // RenderFrameHosts. See https://crbug.com/357747. |
| 129 scoped_ptr<RenderFrameHostImpl> render_frame_host_; | 125 scoped_ptr<RenderFrameHostImpl> render_frame_host_; |
| 130 | 126 |
| 131 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); | 127 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); |
| 132 }; | 128 }; |
| 133 | 129 |
| 134 } // namespace | 130 } // namespace |
| 135 | 131 |
| 136 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ | 132 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ |
| OLD | NEW |