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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 bool OnMessageReceived(const IPC::Message& msg) override; | 99 bool OnMessageReceived(const IPC::Message& msg) override; |
100 | 100 |
101 CrossProcessFrameConnector* cross_process_frame_connector() { | 101 CrossProcessFrameConnector* cross_process_frame_connector() { |
102 return cross_process_frame_connector_.get(); | 102 return cross_process_frame_connector_.get(); |
103 } | 103 } |
104 | 104 |
105 // Set the frame's opener to null in the renderer process in response to an | 105 // Set the frame's opener to null in the renderer process in response to an |
106 // action in another renderer process. | 106 // action in another renderer process. |
107 void DisownOpener(); | 107 void DisownOpener(); |
108 | 108 |
| 109 void set_render_frame_proxy_created(bool created) { |
| 110 render_frame_proxy_created_ = created; |
| 111 } |
| 112 |
| 113 // Returns if the RenderFrameProxy for this host is alive. |
| 114 bool is_render_frame_proxy_live() { return render_frame_proxy_created_; } |
| 115 |
109 private: | 116 private: |
110 // IPC Message handlers. | 117 // IPC Message handlers. |
111 void OnOpenURL(const FrameHostMsg_OpenURL_Params& params); | 118 void OnOpenURL(const FrameHostMsg_OpenURL_Params& params); |
112 | 119 |
113 // This RenderFrameProxyHost's routing id. | 120 // This RenderFrameProxyHost's routing id. |
114 int routing_id_; | 121 int routing_id_; |
115 | 122 |
116 // The SiteInstance this proxy is associated with. | 123 // The SiteInstance this proxy is associated with. |
117 scoped_refptr<SiteInstance> site_instance_; | 124 scoped_refptr<SiteInstance> site_instance_; |
118 | 125 |
119 // The renderer process this RenderFrameHostProxy is associated with. It is | 126 // The renderer process this RenderFrameHostProxy is associated with. It is |
120 // equivalent to the result of site_instance_->GetProcess(), but that | 127 // equivalent to the result of site_instance_->GetProcess(), but that |
121 // method has the side effect of creating the process if it doesn't exist. | 128 // method has the side effect of creating the process if it doesn't exist. |
122 // Cache a pointer to avoid unnecessary process creation. | 129 // Cache a pointer to avoid unnecessary process creation. |
123 RenderProcessHost* process_; | 130 RenderProcessHost* process_; |
124 | 131 |
125 // The node in the frame tree where this proxy is located. | 132 // The node in the frame tree where this proxy is located. |
126 FrameTreeNode* frame_tree_node_; | 133 FrameTreeNode* frame_tree_node_; |
127 | 134 |
| 135 // True if we have a live RenderFrameProxy for this host. |
| 136 bool render_frame_proxy_created_; |
| 137 |
128 // When a RenderFrameHost is in a different process from its parent in the | 138 // When a RenderFrameHost is in a different process from its parent in the |
129 // frame tree, this class connects its associated RenderWidgetHostView | 139 // frame tree, this class connects its associated RenderWidgetHostView |
130 // to this RenderFrameProxyHost, which corresponds to the same frame in the | 140 // to this RenderFrameProxyHost, which corresponds to the same frame in the |
131 // parent's renderer process. | 141 // parent's renderer process. |
132 scoped_ptr<CrossProcessFrameConnector> cross_process_frame_connector_; | 142 scoped_ptr<CrossProcessFrameConnector> cross_process_frame_connector_; |
133 | 143 |
134 // TODO(nasko): This can be removed once we don't have a swapped out state on | 144 // TODO(nasko): This can be removed once we don't have a swapped out state on |
135 // RenderFrameHosts. See https://crbug.com/357747. | 145 // RenderFrameHosts. See https://crbug.com/357747. |
136 scoped_ptr<RenderFrameHostImpl> render_frame_host_; | 146 scoped_ptr<RenderFrameHostImpl> render_frame_host_; |
137 | 147 |
138 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); | 148 DISALLOW_COPY_AND_ASSIGN(RenderFrameProxyHost); |
139 }; | 149 }; |
140 | 150 |
141 } // namespace | 151 } // namespace |
142 | 152 |
143 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ | 153 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_PROXY_HOST_H_ |
OLD | NEW |