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

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: git cl format, changed WebWidget creation Created 6 years 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 70ef6ffe2de0f5526d0f85b5744bf106d477ee71..b28ab339de83978d222da33dec32928e3d3f0c7d 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 the root
+ // of a subtree of frames that are being rendered in the same process.
Charlie Reis 2014/12/18 18:04:13 Is this another way of saying it's used for subfra
kenrb 2015/01/05 21:15:30 I have changed it. The fact that a single node wit
+ CREATE_RF_NEEDS_RENDER_WIDGET_HOST = 1 << 3
};
class CONTENT_EXPORT RenderFrameHostImpl
@@ -189,10 +195,19 @@ 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);
Charlie Reis 2014/12/18 18:04:13 Can we move this closer to CreateRenderFrame, rath
kenrb 2015/01/05 21:15:30 Done.
+
+ // This returns the RenderFrameHost's owned RenderWidgetHost if it has one,
+ // or else it returns a pointer to the RenderViewHost (which inherits
Charlie Reis 2014/12/18 18:04:13 In a grandchild case like A-embed-B1-embed-B2, wha
kenrb 2015/01/05 21:15:30 We discussed this a couple of months ago, there is
Charlie Reis 2015/01/06 00:04:57 I'm ok with returning nullptr if the RFH doesn't h
kenrb 2015/01/06 17:39:03 Done.
+ // 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
@@ -393,6 +408,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,
@@ -532,6 +548,16 @@ class CONTENT_EXPORT RenderFrameHostImpl
// ExecuteJavaScript and their corresponding callbacks.
std::map<int, JavaScriptResultCallback> javascript_callbacks_;
+ // Map from notification_id to a callback to cancel them.
Charlie Reis 2014/12/18 18:04:13 This is a bit generic. Can you say what these not
kenrb 2015/01/05 21:15:30 This isn't my code, I assume a merge resolution er
+ 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.
Charlie Reis 2014/12/18 18:04:13 ... when RenderFrameHost owns its RenderViewHost.
kenrb 2015/01/05 21:15:30 I was thinking when RenderViewHost and RenderWidge
+ scoped_ptr<RenderWidgetHostImpl> render_widget_host_;
+
int routing_id_;
// The current state of this RenderFrameHost.

Powered by Google App Engine
This is Rietveld 408576698