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

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

Issue 616133002: Make RenderFrame(Host) own a RenderWidget(Host). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test update, RWH lifetime fix Created 5 years, 11 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 720235227365ec2a878d20f71b2ef2cba69e3af9..1f57f13f9bd59a22871b4630b8dfaecda82e261f 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -59,7 +59,9 @@ class RenderFrameHostDelegate;
class RenderFrameProxyHost;
class RenderProcessHost;
class RenderViewHostImpl;
+class RenderWidgetHostDelegate;
class RenderWidgetHostImpl;
+class RenderWidgetHostView;
class StreamHandle;
class TimeoutMonitor;
struct CommitNavigationParams;
@@ -78,7 +80,11 @@ enum CreateRenderFrameFlags {
// top-level frame.
CREATE_RF_FOR_MAIN_FRAME_NAVIGATION = 1 << 1,
// The RenderFrame is initially hidden.
- CREATE_RF_HIDDEN = 1 << 2
+ CREATE_RF_HIDDEN = 1 << 2,
+ // The RenderFrameHost will have a new RenderWidgetHost created and
+ // attached to it. This is used when the RenderFrameHost is in a different
+ // process from its parent frame.
+ CREATE_RF_NEEDS_RENDER_WIDGET_HOST = 1 << 3
};
class CONTENT_EXPORT RenderFrameHostImpl
@@ -189,10 +195,17 @@ class CONTENT_EXPORT RenderFrameHostImpl
RenderViewHostImpl* render_view_host() { return render_view_host_; }
RenderFrameHostDelegate* delegate() { return delegate_; }
FrameTreeNode* frame_tree_node() { return frame_tree_node_; }
- // TODO(nasko): The RenderWidgetHost will be owned by RenderFrameHost in
- // the future, so update this accessor to return the right pointer.
+
+ // 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).
RenderWidgetHostImpl* GetRenderWidgetHost();
+ // This returns the RenderWidgetHostView that can be used to control
+ // focus and visibility for this frame.
+ RenderWidgetHostView* GetView();
+
// This function is called when this is a swapped out RenderFrameHost that
// lives in the same process as the parent frame. The
// |cross_process_frame_connector| allows the non-swapped-out
@@ -397,6 +410,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
// into WebContentsObserver::FrameDetached for now.
RenderFrameHostImpl(RenderViewHostImpl* render_view_host,
RenderFrameHostDelegate* delegate,
+ RenderWidgetHostDelegate* rwh_delegate,
FrameTree* frame_tree,
FrameTreeNode* frame_tree_node,
int routing_id,
@@ -536,6 +550,14 @@ class CONTENT_EXPORT RenderFrameHostImpl
// ExecuteJavaScript and their corresponding callbacks.
std::map<int, JavaScriptResultCallback> javascript_callbacks_;
+ // RenderFrameHosts that need management of the rendering and input events
+ // for their frame subtrees require RenderWidgetHosts. This typically
+ // means frames that are rendered in different processes from their parent
+ // frames.
+ // TODO(kenrb): Later this will also be used on the top-level frame, when
+ // RenderFrameHost owns its RenderViewHost.
+ scoped_ptr<RenderWidgetHostImpl> render_widget_host_;
+
int routing_id_;
// The current state of this RenderFrameHost.

Powered by Google App Engine
This is Rietveld 408576698