summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 21:47:30 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 21:47:30 +0000
commitcb291e642a4fe2d36c2354a1bfdb843661de74a0 (patch)
treebb6c13ad7586ad839c0f0d332410842804a3a2da /chrome_frame/test
parent981b34450805e070b6694c8df292f24ee1f73ff4 (diff)
downloadchromium_src-cb291e642a4fe2d36c2354a1bfdb843661de74a0.zip
chromium_src-cb291e642a4fe2d36c2354a1bfdb843661de74a0.tar.gz
chromium_src-cb291e642a4fe2d36c2354a1bfdb843661de74a0.tar.bz2
Revert 47453 - In ChromeFrame the ChromeFrameAutomationProxy object is created on the background proxy channel thread and is accessed
from the UI thread, the proxy channel thread and the IPC thread. This leads to a race condition when ChromeFrame is being torn down which occurs because the ChromeFrameAutomationProxy pointer is being set to NULL in the UI thread/deleted in the proxy background thread while it could be accessed while processing a callback in the IPC thread thus causing a crash. Fix is to ensure that the IPC thread does not access the ChromeFrameAutomationProxy pointer. To achieve this the callbacks are now individual context objects which when invoked forward the actions to the ChromeFrameAutomationClient object. The CreateExternalTab and ConnectExternalTab callbacks now complete their actions on the UI thread. While at this based on a discussion and lot of help from Stoyan we decided to clean up the sync message dispatching code used by ChromeFrame by having callbacks now derive from a SyncMessageCallContext class to ensure that these get cleaned up correctly in all cases. For e.g. if we don't receive a response for a message, etc and thus enable them to present a consistent interface to be invoked when we receive a response for a IPc message. Fixes bug http://code.google.com/p/chromium/issues/detail?id=44245 Bug=44245 Review URL: http://codereview.chromium.org/2073007 TBR=ananta@chromium.org Review URL: http://codereview.chromium.org/2110006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/automation_client_mock.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/chrome_frame/test/automation_client_mock.h b/chrome_frame/test/automation_client_mock.h
index 09b1484..d08d62d3 100644
--- a/chrome_frame/test/automation_client_mock.h
+++ b/chrome_frame/test/automation_client_mock.h
@@ -90,10 +90,8 @@ struct MockCFDelegate : public ChromeFrameDelegateImpl {
class MockAutomationProxy : public ChromeFrameAutomationProxy {
public:
MOCK_METHOD1(Send, bool(IPC::Message*));
- MOCK_METHOD3(SendAsAsync,
- void(IPC::SyncMessage* msg,
- SyncMessageReplyDispatcher::SyncMessageCallContext* context,
- void* key));
+ MOCK_METHOD3(SendAsAsync, void(IPC::SyncMessage* msg, void* callback,
+ void* key));
MOCK_METHOD1(CancelAsync, void(void* key));
MOCK_METHOD1(CreateTabProxy, scoped_refptr<TabProxy>(int handle));
MOCK_METHOD1(ReleaseTabProxy, void(AutomationHandle handle));