diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-09 00:44:32 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-09 00:44:32 +0000 |
commit | 1e803e5716f35cc09b19db3022b6b5e213cf325a (patch) | |
tree | ede3a12c91a8caf2e89026995b5db057edc8bfb8 /chrome/browser | |
parent | 73eac3cc93b59aa55aa5d03ca31cdb5012aef641 (diff) | |
download | chromium_src-1e803e5716f35cc09b19db3022b6b5e213cf325a.zip chromium_src-1e803e5716f35cc09b19db3022b6b5e213cf325a.tar.gz chromium_src-1e803e5716f35cc09b19db3022b6b5e213cf325a.tar.bz2 |
Make sure that the active tab contents is destroyed when navigating back from the tab contents to the downloads page. This is a special case as the current code in the navigation controller only schedules a tab contents for destroy when the tab contents displayed last is different from the active tab contents. When we navigate away from a webcontents to the Downloads page which is a native UI tab contents,
we check for whether the last displayed tab contents type differs from the active type. They both match as the back operation is yet to be initiated.
Eventually the active tab contents change to the download page. We don't clean up the previous tab contents fully thus resulting in the renderer process continuing to run.
This fixes http://code.google.com/p/chromium/issues/detail?id=5828
R=jcampan
Review URL: http://codereview.chromium.org/17258
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/navigation_controller.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/navigation_controller.cc b/chrome/browser/navigation_controller.cc index 3e34702..c5373aa 100644 --- a/chrome/browser/navigation_controller.cc +++ b/chrome/browser/navigation_controller.cc @@ -1013,6 +1013,13 @@ void NavigationController::NavigateToPendingEntry(bool reload) { if (from_contents && from_contents != contents) { if (from_contents->delegate()) from_contents->delegate()->ReplaceContents(from_contents, contents); + + if (from_contents->type() != contents->type()) { + // The entry we just discarded needed a different TabContents type. We no + // longer need it but we can't destroy it just yet because the TabContents + // is very likely involved in the current stack. + ScheduleTabContentsCollection(from_contents->type()); + } } NavigationEntry temp_entry(*pending_entry_); |