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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // creates a RenderFrameProxyHost for the old SiteInstance and uses it going | 56 // creates a RenderFrameProxyHost for the old SiteInstance and uses it going |
57 // forward. It also instructs the RenderFrameHost to run the unload event | 57 // forward. It also instructs the RenderFrameHost to run the unload event |
58 // handler and is kept alive for the duration. Once the event handling is | 58 // handler and is kept alive for the duration. Once the event handling is |
59 // complete, the RenderFrameHost is deleted. | 59 // complete, the RenderFrameHost is deleted. |
60 class RenderFrameProxyHost | 60 class RenderFrameProxyHost |
61 : public IPC::Listener, | 61 : public IPC::Listener, |
62 public IPC::Sender { | 62 public IPC::Sender { |
63 public: | 63 public: |
64 static RenderFrameProxyHost* FromID(int process_id, int routing_id); | 64 static RenderFrameProxyHost* FromID(int process_id, int routing_id); |
65 | 65 |
66 RenderFrameProxyHost(SiteInstance* site_instance, | 66 RenderFrameProxyHost(SiteInstanceImpl* site_instance, |
67 RenderViewHostImpl* render_view_host, | 67 RenderViewHostImpl* render_view_host, |
68 FrameTreeNode* frame_tree_node); | 68 FrameTreeNode* frame_tree_node); |
69 ~RenderFrameProxyHost() override; | 69 ~RenderFrameProxyHost() override; |
70 | 70 |
71 RenderProcessHost* GetProcess() { | 71 RenderProcessHost* GetProcess() { |
72 return process_; | 72 return process_; |
73 } | 73 } |
74 | 74 |
75 // Initializes the object and creates the RenderFrameProxy in the process | 75 // Initializes the object and creates the RenderFrameProxy in the process |
76 // for the SiteInstance. | 76 // for the SiteInstance. |
77 bool InitRenderFrameProxy(); | 77 bool InitRenderFrameProxy(); |
78 | 78 |
79 int GetRoutingID() { | 79 int GetRoutingID() { |
80 return routing_id_; | 80 return routing_id_; |
81 } | 81 } |
82 | 82 |
83 SiteInstance* GetSiteInstance() { | 83 SiteInstanceImpl* GetSiteInstance() { return site_instance_.get(); } |
84 return site_instance_.get(); | |
85 } | |
86 | 84 |
87 FrameTreeNode* frame_tree_node() const { return frame_tree_node_; }; | 85 FrameTreeNode* frame_tree_node() const { return frame_tree_node_; }; |
88 | 86 |
89 void SetChildRWHView(RenderWidgetHostView* view); | 87 void SetChildRWHView(RenderWidgetHostView* view); |
90 | 88 |
91 // TODO(nasko): The following methods should be removed once we don't have a | 89 // TODO(nasko): The following methods should be removed once we don't have a |
92 // swapped out state on RenderFrameHosts. See https://crbug.com/357747. | 90 // swapped out state on RenderFrameHosts. See https://crbug.com/357747. |
93 RenderFrameHostImpl* render_frame_host() { | 91 RenderFrameHostImpl* render_frame_host() { |
94 return render_frame_host_.get(); | 92 return render_frame_host_.get(); |
95 } | 93 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void OnDetach(); | 126 void OnDetach(); |
129 void OnOpenURL(const FrameHostMsg_OpenURL_Params& params); | 127 void OnOpenURL(const FrameHostMsg_OpenURL_Params& params); |
130 void OnRouteMessageEvent(const FrameMsg_PostMessage_Params& params); | 128 void OnRouteMessageEvent(const FrameMsg_PostMessage_Params& params); |
131 void OnDidChangeOpener(int32_t opener_routing_id); | 129 void OnDidChangeOpener(int32_t opener_routing_id); |
132 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); | 130 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); |
133 void OnFrameFocused(); | 131 void OnFrameFocused(); |
134 | 132 |
135 // This RenderFrameProxyHost's routing id. | 133 // This RenderFrameProxyHost's routing id. |
136 int routing_id_; | 134 int routing_id_; |
137 | 135 |
138 // The SiteInstance this proxy is associated with. | 136 // The SiteInstanceImpl this proxy is associated with. |
139 scoped_refptr<SiteInstance> site_instance_; | 137 scoped_refptr<SiteInstanceImpl> site_instance_; |
140 | 138 |
141 // The renderer process this RenderFrameHostProxy is associated with. It is | 139 // The renderer process this RenderFrameHostProxy is associated with. It is |
142 // equivalent to the result of site_instance_->GetProcess(), but that | 140 // equivalent to the result of site_instance_->GetProcess(), but that |
143 // method has the side effect of creating the process if it doesn't exist. | 141 // method has the side effect of creating the process if it doesn't exist. |
144 // Cache a pointer to avoid unnecessary process creation. | 142 // Cache a pointer to avoid unnecessary process creation. |
145 RenderProcessHost* process_; | 143 RenderProcessHost* process_; |
146 | 144 |
147 // The node in the frame tree where this proxy is located. | 145 // The node in the frame tree where this proxy is located. |
148 FrameTreeNode* frame_tree_node_; | 146 FrameTreeNode* frame_tree_node_; |
149 | 147 |
(...skipping 14 matching lines...) Expand all Loading... |
164 // kept alive as long as any RenderFrameHosts or RenderFrameProxyHosts | 162 // kept alive as long as any RenderFrameHosts or RenderFrameProxyHosts |
165 // are associated with it. | 163 // are associated with it. |
166 RenderViewHostImpl* render_view_host_; | 164 RenderViewHostImpl* render_view_host_; |
167 | 165 |
168 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); | 166 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); |
169 }; | 167 }; |
170 | 168 |
171 } // namespace | 169 } // namespace |
172 | 170 |
173 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ | 171 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ |
OLD | NEW |