From 1e803e5716f35cc09b19db3022b6b5e213cf325a Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Fri, 9 Jan 2009 00:44:32 +0000 Subject: 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 --- chrome/browser/navigation_controller.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/browser') 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_); -- cgit v1.1