Skip to content
Snippets Groups Projects
Commit 1d6b2b85 authored by ojan@google.com's avatar ojan@google.com
Browse files

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
parent c82192d6
No related branches found
No related tags found
No related merge requests found
...@@ -518,6 +518,9 @@ void RenderViewHost::CaptureThumbnail() { ...@@ -518,6 +518,9 @@ void RenderViewHost::CaptureThumbnail() {
void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg, void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg,
bool success, bool success,
const std::wstring& prompt) { const std::wstring& prompt) {
if (is_waiting_for_unload_ack_)
StartHangMonitorTimeout(kUnloadTimeoutMS);
if (--modal_dialog_count_ == 0) if (--modal_dialog_count_ == 0)
ResetEvent(modal_dialog_event_.Get()); ResetEvent(modal_dialog_event_.Get());
ViewHostMsg_RunJavaScriptMessage::WriteReplyParams(reply_msg, success, prompt); ViewHostMsg_RunJavaScriptMessage::WriteReplyParams(reply_msg, success, prompt);
...@@ -526,6 +529,9 @@ void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg, ...@@ -526,6 +529,9 @@ void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg,
void RenderViewHost::ModalHTMLDialogClosed(IPC::Message* reply_msg, void RenderViewHost::ModalHTMLDialogClosed(IPC::Message* reply_msg,
const std::string& json_retval) { const std::string& json_retval) {
if (is_waiting_for_unload_ack_)
StartHangMonitorTimeout(kUnloadTimeoutMS);
if (--modal_dialog_count_ == 0) if (--modal_dialog_count_ == 0)
ResetEvent(modal_dialog_event_.Get()); ResetEvent(modal_dialog_event_.Get());
...@@ -1023,6 +1029,7 @@ void RenderViewHost::OnMsgRunJavaScriptMessage( ...@@ -1023,6 +1029,7 @@ void RenderViewHost::OnMsgRunJavaScriptMessage(
const std::wstring& default_prompt, const std::wstring& default_prompt,
const int flags, const int flags,
IPC::Message* reply_msg) { IPC::Message* reply_msg) {
StopHangMonitorTimeout();
if (modal_dialog_count_++ == 0) if (modal_dialog_count_++ == 0)
SetEvent(modal_dialog_event_.Get()); SetEvent(modal_dialog_event_.Get());
delegate_->RunJavaScriptMessage(message, default_prompt, flags, reply_msg); delegate_->RunJavaScriptMessage(message, default_prompt, flags, reply_msg);
...@@ -1030,6 +1037,7 @@ void RenderViewHost::OnMsgRunJavaScriptMessage( ...@@ -1030,6 +1037,7 @@ void RenderViewHost::OnMsgRunJavaScriptMessage(
void RenderViewHost::OnMsgRunBeforeUnloadConfirm(const std::wstring& message, void RenderViewHost::OnMsgRunBeforeUnloadConfirm(const std::wstring& message,
IPC::Message* reply_msg) { IPC::Message* reply_msg) {
StopHangMonitorTimeout();
if (modal_dialog_count_++ == 0) if (modal_dialog_count_++ == 0)
SetEvent(modal_dialog_event_.Get()); SetEvent(modal_dialog_event_.Get());
delegate_->RunBeforeUnloadConfirm(message, reply_msg); delegate_->RunBeforeUnloadConfirm(message, reply_msg);
...@@ -1038,6 +1046,7 @@ void RenderViewHost::OnMsgRunBeforeUnloadConfirm(const std::wstring& message, ...@@ -1038,6 +1046,7 @@ void RenderViewHost::OnMsgRunBeforeUnloadConfirm(const std::wstring& message,
void RenderViewHost::OnMsgShowModalHTMLDialog( void RenderViewHost::OnMsgShowModalHTMLDialog(
const GURL& url, int width, int height, const std::string& json_arguments, const GURL& url, int width, int height, const std::string& json_arguments,
IPC::Message* reply_msg) { IPC::Message* reply_msg) {
StopHangMonitorTimeout();
if (modal_dialog_count_++ == 0) if (modal_dialog_count_++ == 0)
SetEvent(modal_dialog_event_.Get()); SetEvent(modal_dialog_event_.Get());
delegate_->ShowModalHTMLDialog(url, width, height, json_arguments, reply_msg); delegate_->ShowModalHTMLDialog(url, width, height, json_arguments, reply_msg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment