summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/render_view_host_manager.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 22:39:59 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 22:39:59 +0000
commit6b3f162b963e006c7be711ba02109b664bb24022 (patch)
treeca27458018ce1081325c6ae015148fe992e82510 /chrome/browser/tab_contents/render_view_host_manager.cc
parent00bcbfcbafbb580ed44f189b94b30c2814fd95bb (diff)
downloadchromium_src-6b3f162b963e006c7be711ba02109b664bb24022.zip
chromium_src-6b3f162b963e006c7be711ba02109b664bb24022.tar.gz
chromium_src-6b3f162b963e006c7be711ba02109b664bb24022.tar.bz2
Fix the process creation problem. This forces transitions between
BrowsingInstances when we force a transition for DOM UIs. BUG=9364 TEST=see bug Review URL: http://codereview.chromium.org/67201 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/render_view_host_manager.cc')
-rw-r--r--chrome/browser/tab_contents/render_view_host_manager.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_manager.cc b/chrome/browser/tab_contents/render_view_host_manager.cc
index be813aa..a178356 100644
--- a/chrome/browser/tab_contents/render_view_host_manager.cc
+++ b/chrome/browser/tab_contents/render_view_host_manager.cc
@@ -277,7 +277,7 @@ bool RenderViewHostManager::ShouldTransitionCrossSite() {
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,15 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry(
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 addresses special cases where we use a
+ // single BrowsingInstance for all pages of a certain type (e.g., New Tab
+ // Pages), keeping them in the same process. When you navigate away from
+ // that page, we want to explicity ignore that BrowsingInstance and make a
+ // new process.
+ 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 +498,7 @@ RenderViewHost* RenderViewHostManager::UpdateRendererStateForNavigate(
new_instance = GetSiteInstanceForEntry(entry, curr_instance);
if (new_instance != curr_instance ||
- ShouldSwapRenderViewsForNavigation(
+ ShouldSwapProcessesForNavigation(
delegate_->GetLastCommittedNavigationEntryForRenderManager(),
&entry)) {
// New SiteInstance.