summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/chrome_frame_automation_provider.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 20:39:07 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 20:39:07 +0000
commit1f71d58803aa64d574369a85d5b16c1cf8e12b1e (patch)
tree3fb4e95cce604633ec319447eda7cf436570cf89 /chrome/browser/automation/chrome_frame_automation_provider.cc
parent731b4677ab26acf1f6813f5320ef0bec38d325b6 (diff)
downloadchromium_src-1f71d58803aa64d574369a85d5b16c1cf8e12b1e.zip
chromium_src-1f71d58803aa64d574369a85d5b16c1cf8e12b1e.tar.gz
chromium_src-1f71d58803aa64d574369a85d5b16c1cf8e12b1e.tar.bz2
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
Diffstat (limited to 'chrome/browser/automation/chrome_frame_automation_provider.cc')
-rw-r--r--chrome/browser/automation/chrome_frame_automation_provider.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/automation/chrome_frame_automation_provider.cc b/chrome/browser/automation/chrome_frame_automation_provider.cc
index 112f2fc..52f8ded 100644
--- a/chrome/browser/automation/chrome_frame_automation_provider.cc
+++ b/chrome/browser/automation/chrome_frame_automation_provider.cc
@@ -64,7 +64,8 @@ bool ChromeFrameAutomationProvider::IsValidMessage(uint32 type) {
case AutomationMsg_RequestEnd::ID:
case AutomationMsg_SaveAsAsync::ID:
case AutomationMsg_RemoveBrowsingData::ID:
- case AutomationMsg_OverrideEncoding::ID: {
+ case AutomationMsg_OverrideEncoding::ID:
+ case AutomationMsg_RunUnloadHandlers::ID: {
is_valid_message = true;
break;
}