Index: content/browser/frame_host/frame_tree_node.h |
diff --git a/content/browser/frame_host/frame_tree_node.h b/content/browser/frame_host/frame_tree_node.h |
index 9c22b125ba3e13ce182329eadee626aa9262f165..39581b618d48dbb6feb0ba84c0ecbdf98e2ecacf 100644 |
--- a/content/browser/frame_host/frame_tree_node.h |
+++ b/content/browser/frame_host/frame_tree_node.h |
@@ -39,27 +39,12 @@ class CONTENT_EXPORT FrameTreeNode { |
~FrameTreeNode(); |
- void AddChild(scoped_ptr<FrameTreeNode> child); |
+ void AddChild(scoped_ptr<FrameTreeNode> child, int render_frame_host_id); |
void RemoveChild(FrameTreeNode* child); |
- // TODO(nasko): This method should be removed once RenderFrameHosts are |
- // created by RenderFrameHostManager. |
- void set_render_frame_host( |
- RenderFrameHostImpl* render_frame_host, |
- bool owns_render_frame_host) { |
- render_frame_host_ = render_frame_host; |
- owns_render_frame_host_ = owns_render_frame_host; |
- } |
- |
- // Transitional API allowing the RenderFrameHost of a FrameTreeNode |
- // representing the main frame to be provided by someone else. After |
- // this is called, the FrameTreeNode no longer owns its RenderFrameHost. |
- // |
- // This should only be used for the main frame (aka root) in a frame tree. |
- // |
- // TODO(ajwong): Remove this method once the main frame RenderFrameHostImpl is |
- // no longer owned by the RenderViewHostImpl. |
- void ResetForMainFrame(RenderFrameHostImpl* new_render_frame_host); |
+ // Clears process specific-state after a main frame process swap. |
+ // TODO(creis): Look into how we can remove the need for this method. |
+ void ResetForMainFrameSwap(); |
Navigator* navigator() { |
return navigator_.get(); |
@@ -103,8 +88,8 @@ class CONTENT_EXPORT FrameTreeNode { |
current_url_ = url; |
} |
- RenderFrameHostImpl* render_frame_host() const { |
- return render_frame_host_; |
+ RenderFrameHostImpl* current_render_frame_host() const { |
+ return render_manager_.current_frame(); |
} |
private: |
@@ -115,11 +100,10 @@ class CONTENT_EXPORT FrameTreeNode { |
// of the frame tree. |
scoped_refptr<Navigator> navigator_; |
- // Manages creation and swapping of RenderViewHosts for this frame. This must |
- // be declared before |children_| so that it gets deleted after them. That's |
- // currently necessary so that RenderFrameHostImpl's destructor can call |
- // GetProcess. |
- // TODO(creis): This will eliminate the need for |render_frame_host_| below. |
+ // Manages creation and swapping of RenderFrameHosts for this frame. This |
+ // must be declared before |children_| so that it gets deleted after them. |
+ // That's currently necessary so that RenderFrameHostImpl's destructor can |
+ // call GetProcess. |
RenderFrameHostManager render_manager_; |
// A browser-global identifier for the frame in the page, which stays stable |
@@ -139,22 +123,6 @@ class CONTENT_EXPORT FrameTreeNode { |
// The immediate children of this specific frame. |
ScopedVector<FrameTreeNode> children_; |
- // When ResetForMainFrame() is called, this is set to false and the |
- // |render_frame_host_| below is not deleted on destruction. |
- // |
- // For the mainframe, the FrameTree does not own the |render_frame_host_|. |
- // This is a transitional wart because RenderFrameHostManager does not yet |
- // have the bookkeeping logic to handle creating a pending RenderFrameHost |
- // along with a pending RenderViewHost. Thus, for the main frame, the |
- // RenderViewHost currently retains ownership and the FrameTreeNode should |
- // not delete it on destruction. |
- bool owns_render_frame_host_; |
- |
- // The active RenderFrameHost for this frame. The FrameTreeNode does not |
- // always own this pointer. See comments above |owns_render_frame_host_|. |
- // TODO(ajwong): Replace with RenderFrameHostManager. |
- RenderFrameHostImpl* render_frame_host_; |
- |
// Track the current frame's last committed URL, so we can estimate the |
// process impact of out-of-process iframes. |
// TODO(creis): Remove this when we can store subframe URLs in the |