diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 17:55:02 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 17:55:02 +0000 |
commit | 56ee0b56f44f89ab3475756fb95ad98e5e3dbfa1 (patch) | |
tree | b839a2daa8a484fe87c3a94608d8c33f4ee47877 /chrome_frame | |
parent | 6fcdb5d5f85bc9cf5a78cd8816d9ad988ef7a140 (diff) | |
download | chromium_src-56ee0b56f44f89ab3475756fb95ad98e5e3dbfa1.zip chromium_src-56ee0b56f44f89ab3475756fb95ad98e5e3dbfa1.tar.gz chromium_src-56ee0b56f44f89ab3475756fb95ad98e5e3dbfa1.tar.bz2 |
Hopefully the last of the fixes to get Chrome Frame tests going again.
1. Added a check in the OnDestroy handler for the ChromeFrame ActiveX as to whether the
worker thread is valid before posting a task to it.
2. Added a helper function in ChromeFrameAutomationClient to support asynchronous host network
stack requests deletion.
If this does not work I will revert the previous CL's.
TBR=amit
Review URL: http://codereview.chromium.org/338010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 12 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 15 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.h | 3 |
3 files changed, 25 insertions, 5 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index f4a276e..85432ef 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -505,11 +505,13 @@ END_MSG_MAP() 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(); + if (worker_thread_.message_loop()) { + worker_thread_.message_loop()->PostTask( + FROM_HERE, NewRunnableMethod(this, &Base::OnWorkerStop)); + if (automation_client_.get()) + automation_client_->CleanupAsyncRequests(); + worker_thread_.Stop(); + } return 0; } diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index ecbca0c..4529ca3 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -1049,6 +1049,21 @@ void ChromeFrameAutomationClient::CleanupRequests() { request_map_.clear(); } +void ChromeFrameAutomationClient::CleanupAsyncRequests() { + RequestMap::iterator index = request_map_.begin(); + while (index != request_map_.end()) { + PluginUrlRequest* request = (*index).second; + if (request) { + int request_id = request->id(); + request->Stop(); + } + index++; + } + + DCHECK(request_map_.empty()); + request_map_.clear(); +} + bool ChromeFrameAutomationClient::Reinitialize( ChromeFrameDelegate* delegate) { if (!tab_.get() || !::IsWindow(chrome_window_)) { diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index f2120e2..411fdb8 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -240,6 +240,9 @@ class ChromeFrameAutomationClient PluginUrlRequest* LookupRequest(int request_id) const; bool IsValidRequest(PluginUrlRequest* request) const; void CleanupRequests(); + // For IE the host network stack requests are issued on a separate thread, + // which requires the requests to be cleaned up asynchronously. + void CleanupAsyncRequests(); void set_use_chrome_network(bool use_chrome_network) { use_chrome_network_ = use_chrome_network; |