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

Unified Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 23129015: Initialize RenderWidget(Host)(View)s with correct visibility state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/web_contents/render_view_host_manager.cc
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index 9d29a09c6a349cadd2fb5281f76c3dd69444d66f..2c92430be926b3f1df35f470a4e5dee367b02b12 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -83,7 +83,7 @@ void RenderViewHostManager::Init(BrowserContext* browser_context,
render_view_host_ = static_cast<RenderViewHostImpl*>(
RenderViewHostFactory::Create(
site_instance, render_view_delegate_, render_widget_delegate_,
- routing_id, main_frame_routing_id, false));
+ routing_id, main_frame_routing_id, false, delegate_->IsHidden()));
// Keep track of renderer processes as they start to shut down or are
// crashed/killed.
@@ -642,8 +642,10 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry(
int RenderViewHostManager::CreateRenderView(
SiteInstance* instance,
int opener_route_id,
- bool swapped_out) {
+ bool swapped_out,
+ bool hidden) {
CHECK(instance);
+ DCHECK(!swapped_out || hidden); // Swapped out views should always be hidden.
// Check if we've already created an RVH for this SiteInstance. If so, try
// to re-use the existing one, which has already been initialized. We'll
@@ -662,7 +664,8 @@ int RenderViewHostManager::CreateRenderView(
render_widget_delegate_,
MSG_ROUTING_NONE,
MSG_ROUTING_NONE,
- swapped_out));
+ swapped_out,
+ hidden));
// If the new RVH is swapped out already, store it. Otherwise prevent the
// process from exiting while we're trying to navigate in it.
@@ -894,7 +897,8 @@ RenderViewHostImpl* RenderViewHostManager::UpdateRendererStateForNavigate(
// Create a non-swapped-out pending RVH with the given opener and navigate
// it.
- int route_id = CreateRenderView(new_instance, opener_route_id, false);
+ int route_id = CreateRenderView(new_instance, opener_route_id, false,
+ delegate_->IsHidden());
if (route_id == MSG_ROUTING_NONE)
return NULL;

Powered by Google App Engine
This is Rietveld 408576698