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 |
58 RenderFrameProxyHost(SiteInstance* site_instance, | 60 RenderFrameProxyHost(SiteInstance* site_instance, |
59 FrameTreeNode* frame_tree_node); | 61 FrameTreeNode* frame_tree_node); |
60 virtual ~RenderFrameProxyHost(); | 62 virtual ~RenderFrameProxyHost(); |
61 | 63 |
62 RenderProcessHost* GetProcess() { | 64 RenderProcessHost* GetProcess() { |
63 return site_instance_->GetProcess(); | 65 return site_instance_->GetProcess(); |
64 } | 66 } |
65 | 67 |
66 // Initializes the object and creates the RenderFrameProxy in the process | 68 // Initializes the object and creates the RenderFrameProxy in the process |
67 // for the SiteInstance. | 69 // for the SiteInstance. |
68 bool InitRenderFrameProxy(); | 70 bool InitRenderFrameProxy(); |
69 | 71 |
70 int GetRoutingID() { | 72 int GetRoutingID() { |
71 return routing_id_; | 73 return routing_id_; |
72 } | 74 } |
73 | 75 |
74 SiteInstance* GetSiteInstance() { | 76 SiteInstance* GetSiteInstance() { |
75 return site_instance_.get(); | 77 return site_instance_.get(); |
76 } | 78 } |
77 | 79 |
| 80 FrameTreeNode* frame_tree_node() const { return frame_tree_node_; }; |
| 81 |
78 void SetChildRWHView(RenderWidgetHostView* view); | 82 void SetChildRWHView(RenderWidgetHostView* view); |
79 | 83 |
80 // TODO(nasko): The following methods should be removed once we don't have a | 84 // TODO(nasko): The following methods should be removed once we don't have a |
81 // swapped out state on RenderFrameHosts. See https://crbug.com/357747. | 85 // swapped out state on RenderFrameHosts. See https://crbug.com/357747. |
82 RenderFrameHostImpl* render_frame_host() { | 86 RenderFrameHostImpl* render_frame_host() { |
83 return render_frame_host_.get(); | 87 return render_frame_host_.get(); |
84 } | 88 } |
85 RenderViewHostImpl* GetRenderViewHost(); | 89 RenderViewHostImpl* GetRenderViewHost(); |
86 | 90 |
87 void TakeFrameHostOwnership( | 91 void TakeFrameHostOwnership( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // TODO(nasko): This can be removed once we don't have a swapped out state on | 127 // TODO(nasko): This can be removed once we don't have a swapped out state on |
124 // RenderFrameHosts. See https://crbug.com/357747. | 128 // RenderFrameHosts. See https://crbug.com/357747. |
125 scoped_ptr<RenderFrameHostImpl> render_frame_host_; | 129 scoped_ptr<RenderFrameHostImpl> render_frame_host_; |
126 | 130 |
127 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); | 131 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); |
128 }; | 132 }; |
129 | 133 |
130 } // namespace | 134 } // namespace |
131 | 135 |
132 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ | 136 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ |
OLD | NEW |