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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 23841002: Create a new RenderFrameHost per child frame when --site-per-process is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unittests. Created 7 years, 3 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/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 772d0dff1bd91abb6dd5dbfea269b411bb0f15da..ecdc45a36ad5b02751727329dd58af4c3a2341e6 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -28,6 +28,7 @@
#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/browser/host_zoom_map_impl.h"
#include "content/browser/renderer_host/dip_util.h"
+#include "content/browser/renderer_host/frame_tree.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/common/accessibility_messages.h"
@@ -184,7 +185,8 @@ RenderViewHostImpl::RenderViewHostImpl(
main_frame_routing_id = GetProcess()->GetNextRoutingID();
main_render_frame_host_.reset(
- new RenderFrameHostImpl(this, main_frame_routing_id, is_swapped_out_));
+ new RenderFrameHostImpl(GetProcess(), delegate_->GetFrameTree(),
+ main_frame_routing_id, is_swapped_out_));
GetProcess()->EnableSendQueue();
@@ -255,7 +257,7 @@ bool RenderViewHostImpl::CreateRenderView(
delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext());
params.web_preferences = delegate_->GetWebkitPrefs();
params.view_id = GetRoutingID();
- params.main_frame_routing_id = main_render_frame_host_->routing_id();
+ params.main_frame_routing_id = main_render_frame_host()->routing_id();
params.surface_id = surface_id();
params.session_storage_namespace_id =
delegate_->GetSessionStorageNamespace(instance_)->id();
@@ -2031,11 +2033,6 @@ void RenderViewHostImpl::OnShowPopup(
}
#endif
-RenderFrameHostImpl* RenderViewHostImpl::main_render_frame_host() const {
- DCHECK_EQ(GetProcess(), main_render_frame_host_->GetProcess());
- return main_render_frame_host_.get();
-}
-
void RenderViewHostImpl::SetSwappedOut(bool is_swapped_out) {
// We update the number of RenderViews in a SiteInstance when the
// swapped out status of this RenderView gets flipped.
@@ -2068,4 +2065,13 @@ bool RenderViewHostImpl::CanAccessFilesOfPageState(
return true;
}
+void RenderViewHostImpl::AttachToFrameTree() {
+ FrameTree* frame_tree = delegate_->GetFrameTree();
+
+ frame_tree->SwapMainFrame(main_render_frame_host_.get());
+ if (main_frame_id() != FrameTreeNode::kInvalidFrameId) {
+ frame_tree->OnFirstNavigationAfterSwap(main_frame_id());
+ }
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698