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

Unified Diff: content/browser/frame_host/frame_tree.cc

Issue 782093002: Ensure that before creating proxy of site A, RVH of site A is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Create new RVH instead of re-using + Add test 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/frame_tree.cc
diff --git a/content/browser/frame_host/frame_tree.cc b/content/browser/frame_host/frame_tree.cc
index 96890f09075d9e438e750271b3405f8ae3b2d80f..3934ec5d941084d0edecda7416665f0cd0169773 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -204,7 +204,7 @@ void FrameTree::CreateProxiesForSiteInstance(
if (!source->IsMainFrame()) {
RenderViewHostImpl* render_view_host =
source->frame_tree()->GetRenderViewHost(site_instance);
- if (!render_view_host) {
+ if (!render_view_host || !render_view_host->IsRenderViewLive()) {
root()->render_manager()->CreateRenderFrame(
Charlie Reis 2014/12/12 19:18:31 I took a closer look, and now I'm not sure this is
nasko 2014/12/12 22:25:01 I agree we shouldn't be calling CreateRenderFrame.
lazyboy 2014/12/16 07:10:04 For context about uninitialized RVH: 1 / \ 2
site_instance, nullptr, MSG_ROUTING_NONE,
CREATE_RF_SWAPPED_OUT | CREATE_RF_HIDDEN, nullptr);
@@ -265,8 +265,10 @@ RenderViewHostImpl* FrameTree::CreateRenderViewHost(SiteInstance* site_instance,
// Otherwise return the existing RenderViewHost for the SiteInstance.
RenderFrameHostImpl* main_frame = static_cast<RenderFrameHostImpl*>(
iter->second->GetMainFrame());
- if (main_frame->frame_tree_node()->render_manager()->IsPendingDeletion(
- main_frame)) {
+ // |main_frame| is NULL when the RVH is uninitialized.
nasko 2014/12/12 22:25:01 What sequence of events causes uninitialized RVH t
lazyboy 2014/12/23 22:03:11 Since we keep around the proxy (with swapped out r
+ if (!main_frame ||
+ main_frame->frame_tree_node()->render_manager()->IsPendingDeletion(
+ main_frame)) {
render_view_host_pending_shutdown_map_.insert(
std::pair<int, RenderViewHostImpl*>(site_instance->GetId(),
iter->second));
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | content/browser/site_per_process_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698