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>2009-10-24 16:26:46 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-24 16:26:46 +0000
commite9eb50ca6ab2cce6d067b67dd32fc7609f2cc35d (patch)
treef29f33acff1374fcbdef5e11cc96138832b1d8cf /chrome_frame/chrome_frame_activex_base.h
parent68bcfcb4872242451c52a50367d9e560a327650d (diff)
downloadchromium_src-e9eb50ca6ab2cce6d067b67dd32fc7609f2cc35d.zip
chromium_src-e9eb50ca6ab2cce6d067b67dd32fc7609f2cc35d.tar.gz
chromium_src-e9eb50ca6ab2cce6d067b67dd32fc7609f2cc35d.tar.bz2
Attempts to get the chrome_frame_tests going again on the chrome frame builder. Fixes as below:-
1. Removed a DCHECK from ChromeFrameAutomationClient::CleanupRequests which checks if the request was actually deleted. This DCHECK is not correct anymore as the request is stopped asynchronously. 2. We now stop the worker thread in WM_DESTROY as the activex window needs to be valid for Urlmon requests to be released correctly. In some cases IE reuses the ActiveX instance. So we need to create the worker thread on demand. TBR=amit Review URL: http://codereview.chromium.org/334020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_activex_base.h')
-rw-r--r--chrome_frame/chrome_frame_activex_base.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h
index 84b5fbc..f4a276e 100644
--- a/chrome_frame/chrome_frame_activex_base.h
+++ b/chrome_frame/chrome_frame_activex_base.h
@@ -201,6 +201,7 @@ END_CONNECTION_POINT_MAP()
BEGIN_MSG_MAP(ChromeFrameActivexBase)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
+ MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
CHAIN_MSG_MAP(ChromeFramePlugin<T>)
CHAIN_MSG_MAP(CComControl<T>)
CHAIN_MSG_MAP(TaskMarshaller)
@@ -238,12 +239,6 @@ END_MSG_MAP()
IE_8,
IE_8 + 1);
}
-
- base::Thread::Options options;
- options.message_loop_type = MessageLoop::TYPE_UI;
- worker_thread_.StartWithOptions(options);
- worker_thread_.message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStart));
return S_OK;
}
@@ -324,13 +319,6 @@ END_MSG_MAP()
return true;
}
- virtual void OnFinalMessage(HWND) {
- ChromeFramePlugin<T>::Uninitialize();
- worker_thread_.message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStop));
- worker_thread_.Stop();
- }
-
protected:
virtual void OnTabbedOut(int tab_handle, bool reverse) {
DCHECK(m_bInPlaceActive);
@@ -432,6 +420,16 @@ END_MSG_MAP()
virtual void OnRequestStart(int tab_handle, int request_id,
const IPC::AutomationURLRequest& request_info) {
+ // The worker thread may have been stopped. This could happen if the
+ // ActiveX instance was reused.
+ if (!worker_thread_.message_loop()) {
+ base::Thread::Options options;
+ options.message_loop_type = MessageLoop::TYPE_UI;
+ worker_thread_.StartWithOptions(options);
+ worker_thread_.message_loop()->PostTask(
+ FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStart));
+ }
+
scoped_refptr<CComObject<UrlmonUrlRequest> > request;
if (base_url_request_.get() &&
GURL(base_url_request_->url()) == GURL(request_info.url)) {
@@ -505,6 +503,16 @@ END_MSG_MAP()
return 0;
}
+ LRESULT OnDestroy(UINT message, WPARAM wparam, LPARAM lparam,
+ BOOL& handled) { // NO_LINT
+ worker_thread_.message_loop()->PostTask(
+ FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStop));
+ if (automation_client_.get())
+ automation_client_->CleanupRequests();
+ worker_thread_.Stop();
+ return 0;
+ }
+
// ChromeFrameDelegate override
virtual void OnAutomationServerReady() {
ChromeFramePlugin<T>::OnAutomationServerReady();