summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tabs/tab_strip_model.cc
diff options
context:
space:
mode:
authorojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 23:32:47 +0000
committerojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 23:32:47 +0000
commitc82192d62ae8518837f448f9bbd9d0c93cd4af13 (patch)
tree795361f6bb6033caf55862386541c70e08b969be /chrome/browser/tabs/tab_strip_model.cc
parent9a2bba4ed0996b8bc9f8dab235ad83af3f155948 (diff)
downloadchromium_src-c82192d62ae8518837f448f9bbd9d0c93cd4af13.zip
chromium_src-c82192d62ae8518837f448f9bbd9d0c93cd4af13.tar.gz
chromium_src-c82192d62ae8518837f448f9bbd9d0c93cd4af13.tar.bz2
Fix not closing the browser with hung, crashed and interstitial tabs. Adds a 1 second hang monitor for the beforeunload/unload events to fire.
BUG=1296059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs/tab_strip_model.cc')
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 614d29a6..7ada01d 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -269,7 +269,13 @@ bool TabStripModel::TabsAreLoading() const {
bool TabStripModel::TabHasUnloadListener(int index) {
WebContents* web_contents = GetContentsAt(index)->AsWebContents();
if (web_contents) {
- return web_contents->render_view_host()->HasUnloadListener();
+ // If the WebContents is not connected yet, then there's no unload
+ // handler we can fire even if the WebContents has an unload listener.
+ // One case where we hit this is in a tab that has an infinite loop
+ // before load.
+ return web_contents->notify_disconnection() &&
+ !web_contents->IsShowingInterstitialPage() &&
+ web_contents->render_view_host()->HasUnloadListener();
}
return false;
}