Chromium Code Reviews| 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..0141204b77c2ab1ea933090ab9a1c0369d462166 100644 |
| --- a/content/browser/web_contents/render_view_host_manager.cc |
| +++ b/content/browser/web_contents/render_view_host_manager.cc |
| @@ -74,7 +74,8 @@ RenderViewHostManager::~RenderViewHostManager() { |
| void RenderViewHostManager::Init(BrowserContext* browser_context, |
| SiteInstance* site_instance, |
| int routing_id, |
| - int main_frame_routing_id) { |
| + int main_frame_routing_id, |
| + bool hidden) { |
| // Create a RenderViewHost, once we have an instance. It is important to |
| // immediately give this SiteInstance to a RenderViewHost so that it is |
| // ref counted. |
| @@ -83,7 +84,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, hidden)); |
| // Keep track of renderer processes as they start to shut down or are |
| // crashed/killed. |
| @@ -127,11 +128,12 @@ void RenderViewHostManager::SetPendingWebUI(const NavigationEntryImpl& entry) { |
| } |
| RenderViewHostImpl* RenderViewHostManager::Navigate( |
| - const NavigationEntryImpl& entry) { |
| + const NavigationEntryImpl& entry, bool hidden) { |
| TRACE_EVENT0("browser", "RenderViewHostManager:Navigate"); |
| // Create a pending RenderViewHost. It will give us the one we should use |
| RenderViewHostImpl* dest_render_view_host = |
| - static_cast<RenderViewHostImpl*>(UpdateRendererStateForNavigate(entry)); |
| + static_cast<RenderViewHostImpl*>( |
| + UpdateRendererStateForNavigate(entry, hidden)); |
| if (!dest_render_view_host) |
| return NULL; // We weren't able to create a pending render view host. |
| @@ -642,7 +644,8 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry( |
| int RenderViewHostManager::CreateRenderView( |
| SiteInstance* instance, |
| int opener_route_id, |
| - bool swapped_out) { |
| + bool swapped_out, |
| + bool hidden) { |
|
Charlie Reis
2013/08/19 22:18:02
Can we add a DCHECK that swapped_out implies hidde
jamesr
2013/08/19 23:50:39
Done.
|
| CHECK(instance); |
| // Check if we've already created an RVH for this SiteInstance. If so, try |
| @@ -662,7 +665,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. |
| @@ -846,7 +850,7 @@ void RenderViewHostManager::ShutdownRenderViewHostsInSiteInstance( |
| } |
| RenderViewHostImpl* RenderViewHostManager::UpdateRendererStateForNavigate( |
| - const NavigationEntryImpl& entry) { |
| + const NavigationEntryImpl& entry, bool hidden) { |
| // If we are cross-navigating, then we want to get back to normal and navigate |
| // as usual. |
| if (cross_navigation_pending_) { |
| @@ -894,7 +898,10 @@ 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, |
| + hidden); |
|
Charlie Reis
2013/08/19 22:18:02
Style nit: No need for one param-per-line on funct
jamesr
2013/08/19 23:50:39
Hmm. We're inconsistent on this, but sure.
|
| if (route_id == MSG_ROUTING_NONE) |
| return NULL; |