From 1f71d58803aa64d574369a85d5b16c1cf8e12b1e Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Thu, 15 Jul 2010 20:39:07 +0000 Subject: ChromeFrame tabs would hang at times while closing. This would randomly occur if the page had an unload handler. We execute unload handlers in the WM_DESTROY message in the external tab and spin a nested loop waiting for the unload handlers to finish. This causes a deadlock at times if a windows message is dispatched to IE which is blocked in DestroyWindow. The fix is to remove the nested loop mess from the external tab and instead send over a special automation message to Chrome in which context we execute the unload handlers. The message contains the notification window and the actual window message to be posted back when the unload handlers finish executing. The active document/activex spin a GetMessage loop waiting for this message to arrive. To ensure that we don't wait indefinitely we have a 1 second timer and exit the loop if this timer is received. Fixes bug http://code.google.com/p/chromium/issues/detail?id=49132 Bug=49132 Test=Covered by existing unload event test. Review URL: http://codereview.chromium.org/3014001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52523 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/automation/automation_messages_internal.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chrome/test/automation') diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index bdb0d07..d72e6d3 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -1404,4 +1404,15 @@ IPC_BEGIN_MESSAGES(Automation) // None expected IPC_MESSAGE_ROUTED1(AutomationMsg_CloseExternalTab, int) + // This message requests that the external tab identified by the tab handle + // runs unload handlers if any on the current page. + // Request: + // -int: Tab handle + // -gfx::NativeWindow: notification window + // -int: notification message. + // Response: + // None expected + IPC_MESSAGE_ROUTED3(AutomationMsg_RunUnloadHandlers, int, gfx::NativeWindow, + int) + IPC_END_MESSAGES(Automation) -- cgit v1.1