diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-11 23:43:08 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-11 23:43:08 +0000 |
commit | 8a2ce5a0289e90af76c526009c5dfcf6c5048a59 (patch) | |
tree | 38da729456e102e72c61402dcad3c14f13ef8799 /chrome/browser/browser.cc | |
parent | 8da5f94f076fa06dd4a9482e9cb5ae4d77df3af9 (diff) | |
download | chromium_src-8a2ce5a0289e90af76c526009c5dfcf6c5048a59.zip chromium_src-8a2ce5a0289e90af76c526009c5dfcf6c5048a59.tar.gz chromium_src-8a2ce5a0289e90af76c526009c5dfcf6c5048a59.tar.bz2 |
Don't terminate the process when a tab becomes unresponsive during
unload/beforeunload. Instead, just call close on it. If two tabs are in the
same process, then terminating the process is totally wrong.
This also avoids the bugs where we show sad tab, or don't remove the
tab from the tabstrip.
Also, remove a couple of bogus DCHECKS.
BUG=1314995,1301757
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 472fdd9..a2b7928 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -680,7 +680,7 @@ void Browser::ReplaceContents(TabContents* source, TabContents* new_contents) { // Need to do this asynchronously as it will close the tab, which is // currently on the call stack above us. MessageLoop::current()->PostTask(FROM_HERE, - method_factory_.NewRunnableMethod(&Browser::ClearUnloadStateOnCrash, + method_factory_.NewRunnableMethod(&Browser::ClearUnloadState, Source<TabContents>(source).ptr())); } // Need to remove ourselves as an observer for disconnection on the replaced @@ -790,7 +790,7 @@ void Browser::CloseContents(TabContents* source) { // waiting for unload to fire. Don't actually try to close the tab as it // will go down the slow shutdown path instead of the fast path of killing // all the renderer processes. - UnloadFired(source); + ClearUnloadState(source); return; } @@ -847,7 +847,7 @@ void Browser::Observe(NotificationType type, // Need to do this asynchronously as it will close the tab, which is // currently on the call stack above us. MessageLoop::current()->PostTask(FROM_HERE, - method_factory_.NewRunnableMethod(&Browser::ClearUnloadStateOnCrash, + method_factory_.NewRunnableMethod(&Browser::ClearUnloadState, Source<TabContents>(source).ptr())); } } else { @@ -1147,13 +1147,7 @@ void Browser::BeforeUnloadFired(TabContents* tab, *proceed_to_fire_unload = true; } -void Browser::UnloadFired(TabContents* tab) { - DCHECK(is_attempting_to_close_browser_); - RemoveFromVector(&tabs_needing_unload_fired_, tab); - ProcessPendingTabs(); -} - -void Browser::ClearUnloadStateOnCrash(TabContents* tab) { +void Browser::ClearUnloadState(TabContents* tab) { DCHECK(is_attempting_to_close_browser_); RemoveFromVector(&tabs_needing_before_unload_fired_, tab); RemoveFromVector(&tabs_needing_unload_fired_, tab); |