Create a new RenderFrameHost per child frame when --site-per-process is enabled.
This CL is continuation of https://codereview.chromium.org/23841002/:
- Adds a new sync IPC for child frame creation.
- Added frame_messages.h for frame related messages.
- RenderView now creates and closes the main frame
WebFrame rather than relying on the WebView to do it.
- Extracted FrameTree out of WebContents.
FYI, UMA stats for tracking for site instances has been disabled in another CL since they won't make sense until this code is enabled w/o the flag.
Also, FrameHostMsg_Detach is ViewHostMsg_FrameDeatch renamed and FrameHostMsg_CreateChildFrame is ViewHostMsg_FrameAttached renamed plus a little more functionality to get a routing ID assigned by the browser.
(https://codereview.chromium.org/23506013/ is the Blink-side of the CL)
BUG=245126
Review URL: https://codereview.chromium.org/25503004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226779 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 0a44a31..5be2215 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -15,9 +15,9 @@
#include "base/observer_list.h"
#include "base/process/process.h"
#include "base/values.h"
+#include "content/browser/renderer_host/frame_tree.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
-#include "content/browser/web_contents/frame_tree_node.h"
#include "content/browser/web_contents/navigation_controller_impl.h"
#include "content/browser/web_contents/render_view_host_manager.h"
#include "content/common/content_export.h"
@@ -203,10 +203,6 @@
void DragSourceMovedTo(int client_x, int client_y,
int screen_x, int screen_y);
- FrameTreeNode* GetFrameTreeRootForTesting() {
- return frame_tree_root_.get();
- }
-
// WebContents ------------------------------------------------------
virtual WebContentsDelegate* GetDelegate() OVERRIDE;
virtual void SetDelegate(WebContentsDelegate* delegate) OVERRIDE;
@@ -466,6 +462,7 @@
const MediaResponseCallback& callback) OVERRIDE;
virtual SessionStorageNamespace* GetSessionStorageNamespace(
SiteInstance* instance) OVERRIDE;
+ virtual FrameTree* GetFrameTree() OVERRIDE;
// RenderWidgetHostDelegate --------------------------------------------------
@@ -637,10 +634,6 @@
const std::vector<gfx::Size>& original_bitmap_sizes);
void OnUpdateFaviconURL(int32 page_id,
const std::vector<FaviconURL>& candidates);
- void OnFrameAttached(int64 parent_frame_id,
- int64 frame_id,
- const std::string& frame_name);
- void OnFrameDetached(int64 parent_frame_id, int64 frame_id);
void OnMediaNotification(int64 player_cookie,
bool has_video,
@@ -753,8 +746,6 @@
RenderViewHostImpl* GetRenderViewHostImpl();
- FrameTreeNode* FindFrameTreeNodeByID(int64 frame_id);
-
// Removes browser plugin embedder if there is one.
void RemoveBrowserPluginEmbedder();
@@ -767,6 +758,8 @@
// Helper function to invoke WebContentsDelegate::GetSizeForNewRenderView().
gfx::Size GetSizeForNewRenderView() const;
+ void OnFrameRemoved(RenderViewHostImpl* render_view_host, int64 frame_id);
+
// Data for core operation ---------------------------------------------------
// Delegate for notifying our owner about stuff. Not owned by us.
@@ -822,6 +815,9 @@
// Manages creation and swapping of render views.
RenderViewHostManager render_manager_;
+ // The frame tree structure of the current page.
+ FrameTree frame_tree_;
+
#if defined(OS_ANDROID)
// Manages injecting Java objects into all RenderViewHosts associated with
// this WebContentsImpl.
@@ -877,9 +873,6 @@
// True if this is a secure page which displayed insecure content.
bool displayed_insecure_content_;
- // The frame tree structure of the current page.
- scoped_ptr<FrameTreeNode> frame_tree_root_;
-
// Data for misc internal state ----------------------------------------------
// When > 0, the WebContents is currently being captured (e.g., for