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 a440682fe717a3c72186c13fef1a9bacc033150d..177d5c4df93d7121acb48cf266965f7adb9d9775 100644 |
| --- a/content/browser/web_contents/render_view_host_manager.cc |
| +++ b/content/browser/web_contents/render_view_host_manager.cc |
| @@ -29,6 +29,7 @@ |
| using content::NavigationController; |
| using content::NavigationEntry; |
| using content::NavigationEntryImpl; |
| +using content::RenderProcessHost; |
| using content::RenderViewHost; |
| using content::RenderViewHostImpl; |
| using content::RenderWidgetHostView; |
| @@ -255,7 +256,7 @@ void RenderViewHostManager::RendererAbortedProvisionalLoad( |
| } |
| void RenderViewHostManager::RendererProcessClosing( |
| - content::RenderProcessHost* render_process_host) { |
| + RenderProcessHost* render_process_host) { |
| // Remove any swapped out RVHs from this process, so that we don't try to |
| // swap them back in while the process is exiting. Start by finding them, |
| // since there could be more than one. |
| @@ -344,7 +345,7 @@ void RenderViewHostManager::Observe( |
| switch (type) { |
| case content::NOTIFICATION_RENDERER_PROCESS_CLOSING: |
| RendererProcessClosing( |
| - content::Source<content::RenderProcessHost>(source).ptr()); |
| + content::Source<RenderProcessHost>(source).ptr()); |
| break; |
| default: |
| @@ -463,8 +464,18 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry( |
| // to compare against the current URL and not the SiteInstance's site. In |
| // this case, there is no current URL, so comparing against the site is ok. |
| // See additional comments below.) |
| - if (curr_site_instance->HasRelatedSiteInstance(dest_url)) |
| + // |
| + // Also, if the URL should use process-per-site mode and there is an |
| + // existing process for the site, we should use it. We can call |
| + // GetRelatedSiteInstance for this, which will eagerly set the site and |
|
awong
2012/06/27 00:26:54
GetRelatedSiteInstance -> GetRelatedSiteInstance()
Charlie Reis
2012/06/27 20:53:43
Done.
|
| + // thus use the correct process. |
| + bool use_process_per_site = |
| + RenderProcessHost::ShouldUseProcessPerSite(browser_context, dest_url) && |
| + RenderProcessHost::GetProcessHostForSite(browser_context, dest_url); |
| + if (curr_site_instance->HasRelatedSiteInstance(dest_url) || |
| + use_process_per_site) { |
| return curr_site_instance->GetRelatedSiteInstance(dest_url); |
| + } |
| // For extensions, Web UI URLs (such as the new tab page), and apps we do |
| // not want to use the curr_instance if it has no site, since it will have a |