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

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: Rebase Created 6 years, 2 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 698cae02633961121233de6bd3c7f86f35477948..c2b88a3681f99e7f66a1d20f8e22ec3eb01f2622 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -53,7 +53,9 @@ class RenderFrameHostDelegate;
class RenderFrameProxyHost;
class RenderProcessHost;
class RenderViewHostImpl;
+class RenderWidgetHostDelegate;
class RenderWidgetHostImpl;
+class RenderWidgetHostView;
class StreamHandle;
class TimeoutMonitor;
struct CommitNavigationParams;
@@ -66,6 +68,21 @@ struct ResourceResponse;
struct ShowDesktopNotificationHostMsgParams;
struct TransitionLayerData;
+// Flag arguments for RenderFrameHost creation.
+enum CreateRenderFrameFlags {
+ // The RFH will be initially placed on the swapped out hosts list.
+ SWAPPED_OUT = 1 << 0,
+ // The new RenderFrame is being created for a navigation of the
+ // top-level frame.
+ FOR_MAIN_FRAME_NAVIGATION = 1 << 1,
+ // The RenderFrame is initially hidden.
+ HIDDEN = 1 << 2,
+ // The RenderFrameHost will have a new RenderWidgetHost created and
+ // attached to it. This is used when the RenderFrameHost is the root
+ // of a subtree of frames that are being rendered in the same process.
+ CREATE_RENDER_WIDGET_HOST = 1 << 3
+};
+
class CONTENT_EXPORT RenderFrameHostImpl
: public RenderFrameHost,
public BrowserAccessibilityDelegate {
@@ -168,10 +185,20 @@ 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 is called to create RenderWidgetHosts for out-of-process iframes.
+ void CreateRenderWidgetHost(RenderWidgetHostDelegate* delegate,
+ bool hidden);
+
+ // This returns the RenderFrameHost's owned RenderWidgetHost if it has one,
+ // or else it returns 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
@@ -362,10 +389,11 @@ 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,
- bool is_swapped_out);
+ int flags);
private:
friend class TestRenderFrameHost;
@@ -502,6 +530,13 @@ class CONTENT_EXPORT RenderFrameHostImpl
// Map from notification_id to a callback to cancel them.
std::map<int, base::Closure> cancel_notification_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.
+ scoped_ptr<RenderWidgetHostImpl> render_widget_host_;
+
int routing_id_;
// The current state of this RenderFrameHost.

Powered by Google App Engine
This is Rietveld 408576698