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

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: Need a cast in test 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..86b77054601c52ff274ae87b5132c0b407a356b9 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -252,12 +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 the RenderWidgetHostImpl attached to this frame or the nearest
Charlie Reis 2016/05/27 22:50:28 nit: owned by this frame or its nearest (Is that
kenrb 2016/05/30 19:39:54 I think it's accurate enough. Even though technica
+ // ancestor frame, which could potentially be the root. For most input
+ // and rendering related purposes, GetView() should be preferred and
+ // RenderWidgetHostViewBase methods used. Unlike GetView(),
+ // GetRenderWidgetHost() will not return a nullptr.
Charlie Reis 2016/05/27 22:50:28 nit: nullptr after a renderer crash. (Helpful to
kenrb 2016/05/30 19:39:54 Done.
+ //
+ // This method crashes if this RenderFrameHostImpl is not attached to the
+ // frame tree.
Charlie Reis 2016/05/27 22:50:28 nit: if this RenderFrameHost has no RenderWidgetHo
kenrb 2016/05/30 19:39:54 Done.
RenderWidgetHostImpl* GetRenderWidgetHost();
+ // 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 IsLocalRoot();
Charlie Reis 2016/05/27 22:50:28 nit: Let's move this above GetRenderWidgetHost(),
kenrb 2016/05/30 19:39:54 Done.
+
GlobalFrameRoutingId GetGlobalFrameRoutingId();
// This function is called when this is a swapped out RenderFrameHost that

Powered by Google App Engine
This is Rietveld 408576698