Chromium Code Reviews| Index: chrome/browser/tab_contents/render_view_host_manager.cc |
| =================================================================== |
| --- chrome/browser/tab_contents/render_view_host_manager.cc (revision 13870) |
| +++ chrome/browser/tab_contents/render_view_host_manager.cc (working copy) |
| @@ -277,7 +277,7 @@ |
| return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessPerTab); |
| } |
| -bool RenderViewHostManager::ShouldSwapRenderViewsForNavigation( |
| +bool RenderViewHostManager::ShouldSwapProcessesForNavigation( |
| const NavigationEntry* cur_entry, |
| const NavigationEntry* new_entry) const { |
| if (!cur_entry || !new_entry) |
| @@ -378,6 +378,13 @@ |
| if (SiteInstance::IsSameWebSite(current_url, dest_url)) { |
| return curr_instance; |
| + } else if (ShouldSwapProcessesForNavigation(curr_entry, &entry)) { |
| + // When we're swapping, we need to force the site instance AND browsing |
| + // instance to be new ones. This prevents some cases where we'll re-use |
| + // processes opened from the New Tab Page because all NTP's have the same |
| + // BrowsingInstance. |
|
Charlie Reis
2009/04/16 22:00:56
I had trouble following the last sentence. Perhap
|
| + return SiteInstance::CreateSiteInstance( |
| + delegate_->GetControllerForRenderManager()->profile()); |
| } else { |
| // Start the new renderer in a new SiteInstance, but in the current |
| // BrowsingInstance. It is important to immediately give this new |
| @@ -489,7 +496,7 @@ |
| new_instance = GetSiteInstanceForEntry(entry, curr_instance); |
| if (new_instance != curr_instance || |
| - ShouldSwapRenderViewsForNavigation( |
| + ShouldSwapProcessesForNavigation( |
| delegate_->GetLastCommittedNavigationEntryForRenderManager(), |
| &entry)) { |
| // New SiteInstance. |