summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_activex_base.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-04 19:12:10 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-04 19:12:10 +0000
commit41a61cc6e8c27ad71179754cdbdb1ce6bb96e9f1 (patch)
tree54bc4572fe9a923b41e52fb93d96db2149e78b61 /chrome_frame/chrome_frame_activex_base.h
parent8d37b18c3c8c5258fd7a94460eb613df37a3155e (diff)
downloadchromium_src-41a61cc6e8c27ad71179754cdbdb1ce6bb96e9f1.zip
chromium_src-41a61cc6e8c27ad71179754cdbdb1ce6bb96e9f1.tar.gz
chromium_src-41a61cc6e8c27ad71179754cdbdb1ce6bb96e9f1.tar.bz2
Links opened in ChromeFrame via the Open in New window operation would not render if the target
also was rendered in ChromeFrame. This was because we were not marshaling the IMoniker and IBindCtx interfaces over to the ChromeFrame worker thread. The problem would only occur when we reused the existing IMoniker. Fixes bug http://code.google.com/p/chromium/issues/detail?id=30013 We need to post the OnWorkerStop message after we finish stopping the urlmon request object to prevent a race condition. We also need to pump messages in OnDestroy to ensure that CoUninitialize and calls like IBinding::Abort which callback into this thread complete correctly. Bug=30013 Review URL: http://codereview.chromium.org/523018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_activex_base.h')
-rw-r--r--chrome_frame/chrome_frame_activex_base.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h
index 5ba38f8..0ba55e5 100644
--- a/chrome_frame/chrome_frame_activex_base.h
+++ b/chrome_frame/chrome_frame_activex_base.h
@@ -133,6 +133,10 @@ class ATL_NO_VTABLE ProxyDIChromeFrameEvents
extern bool g_first_launch_by_process_;
+// Posted when the worker thread used for handling URL requests in IE finishes
+// uninitialization.
+#define WM_WORKER_THREAD_UNINITIALIZED_MSG (WM_APP + 1)
+
// Common implementation for ActiveX and Active Document
template <class T, const CLSID& class_id>
class ATL_NO_VTABLE ChromeFrameActivexBase : // NOLINT
@@ -554,10 +558,23 @@ END_MSG_MAP()
LRESULT OnDestroy(UINT message, WPARAM wparam, LPARAM lparam,
BOOL& handled) { // NO_LINT
if (worker_thread_.message_loop()) {
- worker_thread_.message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStop));
if (automation_client_.get())
automation_client_->CleanupRequests();
+
+ worker_thread_.message_loop()->PostTask(
+ FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStop));
+
+ MSG msg = {0};
+ while (GetMessage(&msg, NULL, WM_USER,
+ WM_WORKER_THREAD_UNINITIALIZED_MSG)) {
+ if (msg.hwnd == m_hWnd &&
+ msg.message == WM_WORKER_THREAD_UNINITIALIZED_MSG) {
+ break;
+ }
+
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
worker_thread_.Stop();
}
return 0;
@@ -1090,6 +1107,7 @@ END_MSG_MAP()
void OnWorkerStop() {
CoUninitialize();
+ PostMessage(WM_WORKER_THREAD_UNINITIALIZED_MSG, 0, 0);
}
ScopedBstr url_;