Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2023453003: Make RenderFrameHostImpl::GetRenderWidgetHost() always return an object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing creis' comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/render_frame_host_impl.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index 420a2c2795d7512d3ac241213dc4854290d45737..1dd851221cdf625aba822d208adc4836f4a77f44 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -252,10 +252,23 @@ class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost,
// TODO(clamy): Remove this once PlzNavigate ships.
void set_is_loading(bool is_loading) { is_loading_ = is_loading; }
- // This returns the RenderFrameHost's owned RenderWidgetHost if it has one,
- // or else it returns nullptr.
- // If the RenderFrameHost is the page's main frame, this returns instead a
- // pointer to the RenderViewHost (which inherits RenderWidgetHost).
+ // Returns true if this is a top-level frame, or if this frame's RenderFrame
+ // is in a different process from its parent frame. Local roots are
+ // distinguished by owning a RenderWidgetHost, which manages input events
+ // and painting for this frame and its contiguous local subtree in the
+ // renderer process.
+ bool is_local_root() { return !!render_widget_host_; }
+
+ // Returns the RenderWidgetHostImpl attached to this frame or the nearest
+ // ancestor frame, which could potentially be the root. For most input
+ // and rendering related purposes, GetView() should be preferred and
+ // RenderWidgetHostViewBase methods used. GetRenderWidgetHost() will not
+ // return a nullptr, whereas GetView() potentially will (for instance,
+ // after a renderer crash).
+ //
+ // This method crashes if this RenderFrameHostImpl does not own a
+ // a RenderWidgetHost and nor does any of its ancestors. That would
+ // typically mean that the frame has been detached from the frame tree.
RenderWidgetHostImpl* GetRenderWidgetHost();
GlobalFrameRoutingId GetGlobalFrameRoutingId();
« no previous file with comments | « content/browser/frame_host/cross_process_frame_connector.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698