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

Unified Diff: chrome_frame/chrome_frame_activex_base.h

Issue 334020: Attempts to get the chrome_frame_tests going again on the chrome frame builde... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 | « no previous file | chrome_frame/chrome_frame_automation.cc » ('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 29999)
+++ chrome_frame/chrome_frame_activex_base.h (working copy)
@@ -201,6 +201,7 @@
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 @@
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 @@
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 @@
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 @@
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();
« no previous file with comments | « no previous file | chrome_frame/chrome_frame_automation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698