diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-29 23:47:55 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-29 23:47:55 +0000 |
commit | 1d6b2b85fdb0202fc6f17ad4b0f2c4ce83051d4e (patch) | |
tree | b808060d3a2f5d62beb17d475024435142c48a7a /chrome | |
parent | c82192d62ae8518837f448f9bbd9d0c93cd4af13 (diff) | |
download | chromium_src-1d6b2b85fdb0202fc6f17ad4b0f2c4ce83051d4e.zip chromium_src-1d6b2b85fdb0202fc6f17ad4b0f2c4ce83051d4e.tar.gz chromium_src-1d6b2b85fdb0202fc6f17ad4b0f2c4ce83051d4e.tar.bz2 |
Fix hang detection when closing a tab to not fire when a modal dialog is open.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/render_view_host.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc index 2b3ba62..156db86 100644 --- a/chrome/browser/render_view_host.cc +++ b/chrome/browser/render_view_host.cc @@ -518,6 +518,9 @@ void RenderViewHost::CaptureThumbnail() { void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg, bool success, const std::wstring& prompt) { + if (is_waiting_for_unload_ack_) + StartHangMonitorTimeout(kUnloadTimeoutMS); + if (--modal_dialog_count_ == 0) ResetEvent(modal_dialog_event_.Get()); ViewHostMsg_RunJavaScriptMessage::WriteReplyParams(reply_msg, success, prompt); @@ -526,6 +529,9 @@ void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg, void RenderViewHost::ModalHTMLDialogClosed(IPC::Message* reply_msg, const std::string& json_retval) { + if (is_waiting_for_unload_ack_) + StartHangMonitorTimeout(kUnloadTimeoutMS); + if (--modal_dialog_count_ == 0) ResetEvent(modal_dialog_event_.Get()); @@ -1023,6 +1029,7 @@ void RenderViewHost::OnMsgRunJavaScriptMessage( const std::wstring& default_prompt, const int flags, IPC::Message* reply_msg) { + StopHangMonitorTimeout(); if (modal_dialog_count_++ == 0) SetEvent(modal_dialog_event_.Get()); delegate_->RunJavaScriptMessage(message, default_prompt, flags, reply_msg); @@ -1030,6 +1037,7 @@ void RenderViewHost::OnMsgRunJavaScriptMessage( void RenderViewHost::OnMsgRunBeforeUnloadConfirm(const std::wstring& message, IPC::Message* reply_msg) { + StopHangMonitorTimeout(); if (modal_dialog_count_++ == 0) SetEvent(modal_dialog_event_.Get()); delegate_->RunBeforeUnloadConfirm(message, reply_msg); @@ -1038,6 +1046,7 @@ void RenderViewHost::OnMsgRunBeforeUnloadConfirm(const std::wstring& message, void RenderViewHost::OnMsgShowModalHTMLDialog( const GURL& url, int width, int height, const std::string& json_arguments, IPC::Message* reply_msg) { + StopHangMonitorTimeout(); if (modal_dialog_count_++ == 0) SetEvent(modal_dialog_event_.Get()); delegate_->ShowModalHTMLDialog(url, width, height, json_arguments, reply_msg); |