OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // FrameTreeNode. The proper way to check whether a frame is loading is to | 245 // FrameTreeNode. The proper way to check whether a frame is loading is to |
246 // call FrameTreeNode::IsLoading. | 246 // call FrameTreeNode::IsLoading. |
247 bool is_loading() const { return is_loading_; } | 247 bool is_loading() const { return is_loading_; } |
248 | 248 |
249 // Sets this RenderFrameHost loading state. This is only used in the case of | 249 // Sets this RenderFrameHost loading state. This is only used in the case of |
250 // transfer navigations, where no DidStart/DidStopLoading notifications | 250 // transfer navigations, where no DidStart/DidStopLoading notifications |
251 // should be sent during the transfer. | 251 // should be sent during the transfer. |
252 // TODO(clamy): Remove this once PlzNavigate ships. | 252 // TODO(clamy): Remove this once PlzNavigate ships. |
253 void set_is_loading(bool is_loading) { is_loading_ = is_loading; } | 253 void set_is_loading(bool is_loading) { is_loading_ = is_loading; } |
254 | 254 |
255 // This returns the RenderFrameHost's owned RenderWidgetHost if it has one, | 255 // Returns true if this is a top-level frame, or if this frame's RenderFrame |
256 // or else it returns nullptr. | 256 // is in a different process from its parent frame. Local roots are |
257 // If the RenderFrameHost is the page's main frame, this returns instead a | 257 // distinguished by owning a RenderWidgetHost, which manages input events |
258 // pointer to the RenderViewHost (which inherits RenderWidgetHost). | 258 // and painting for this frame and its contiguous local subtree in the |
| 259 // renderer process. |
| 260 bool is_local_root() { return !!render_widget_host_; } |
| 261 |
| 262 // Returns the RenderWidgetHostImpl attached to this frame or the nearest |
| 263 // ancestor frame, which could potentially be the root. For most input |
| 264 // and rendering related purposes, GetView() should be preferred and |
| 265 // RenderWidgetHostViewBase methods used. GetRenderWidgetHost() will not |
| 266 // return a nullptr, whereas GetView() potentially will (for instance, |
| 267 // after a renderer crash). |
| 268 // |
| 269 // This method crashes if this RenderFrameHostImpl does not own a |
| 270 // a RenderWidgetHost and nor does any of its ancestors. That would |
| 271 // typically mean that the frame has been detached from the frame tree. |
259 RenderWidgetHostImpl* GetRenderWidgetHost(); | 272 RenderWidgetHostImpl* GetRenderWidgetHost(); |
260 | 273 |
261 GlobalFrameRoutingId GetGlobalFrameRoutingId(); | 274 GlobalFrameRoutingId GetGlobalFrameRoutingId(); |
262 | 275 |
263 // This function is called when this is a swapped out RenderFrameHost that | 276 // This function is called when this is a swapped out RenderFrameHost that |
264 // lives in the same process as the parent frame. The | 277 // lives in the same process as the parent frame. The |
265 // |cross_process_frame_connector| allows the non-swapped-out | 278 // |cross_process_frame_connector| allows the non-swapped-out |
266 // RenderFrameHost for a frame to communicate with the parent process | 279 // RenderFrameHost for a frame to communicate with the parent process |
267 // so that it may composite drawing data. | 280 // so that it may composite drawing data. |
268 // | 281 // |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 | 992 |
980 // NOTE: This must be the last member. | 993 // NOTE: This must be the last member. |
981 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 994 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
982 | 995 |
983 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 996 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
984 }; | 997 }; |
985 | 998 |
986 } // namespace content | 999 } // namespace content |
987 | 1000 |
988 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1001 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |