Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: chrome_frame/chrome_frame_activex_base.h

Issue 3014001: ChromeFrame tabs would hang at times while closing. This would randomly occur... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/automation/automation_messages_internal.h ('k') | chrome_frame/chrome_frame_automation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/chrome_frame_activex_base.h
===================================================================
--- chrome_frame/chrome_frame_activex_base.h (revision 52332)
+++ chrome_frame/chrome_frame_activex_base.h (working copy)
@@ -361,6 +361,43 @@
return true;
}
+ // IOleInPlaceObject overrides.
+ STDMETHOD(InPlaceDeactivate)(void) {
+ static UINT onload_handlers_done_msg =
+ RegisterWindowMessage(L"ChromeFrame_OnloadHandlersDone");
+
+ if (m_bInPlaceActive && IsWindow() && IsValid()) {
+ static const int kChromeFrameUnloadEventTimerId = 0xdeadbeef;
+ static const int kChromeFrameUnloadEventTimeout = 1000;
+
+ // To prevent us from indefinitely waiting for an acknowledgement from
+ // Chrome indicating that unload handlers have been run, we set a 1
+ // second timer and exit the loop when it fires.
+ ::SetTimer(m_hWnd, kChromeFrameUnloadEventTimerId,
+ kChromeFrameUnloadEventTimeout, NULL);
+
+ automation_client_->RunUnloadHandlers(m_hWnd, onload_handlers_done_msg);
+
+ MSG msg = {0};
+ while (GetMessage(&msg, NULL, 0, 0)) {
+ if (msg.message == onload_handlers_done_msg &&
+ msg.hwnd == m_hWnd) {
+ break;
+ }
+
+ if (msg.message == WM_TIMER &&
+ msg.wParam == kChromeFrameUnloadEventTimerId) {
+ break;
+ }
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ ::KillTimer(m_hWnd, kChromeFrameUnloadEventTimerId);
+ }
+ return IOleInPlaceObjectWindowlessImpl<T>::InPlaceDeactivate();
+ }
+
protected:
virtual void GetProfilePath(const std::wstring& profile_name,
FilePath* profile_path) {
« no previous file with comments | « chrome/test/automation/automation_messages_internal.h ('k') | chrome_frame/chrome_frame_automation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698