summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 06:04:02 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 06:04:02 +0000
commitb82d09c2891542809790785d4b5dbe563420d5ee (patch)
treee56bd64fd2bb51af79865bb6b98fc453a49d455a /chrome_frame
parent38233e6c082d748aac5f55cc38ca0d2e581755a6 (diff)
downloadchromium_src-b82d09c2891542809790785d4b5dbe563420d5ee.zip
chromium_src-b82d09c2891542809790785d4b5dbe563420d5ee.tar.gz
chromium_src-b82d09c2891542809790785d4b5dbe563420d5ee.tar.bz2
Some more chrome frame test pure virtual function call crash fixes. There is another crash which occurs when the remote COM apartment running
in Ie shuts down and tries to free references to the web browser event sink. We unsubscribe from the event sink in the destructor of the ComStackObjectWithUninitialize object. The call to DispEventUnadvise fails every time. Unsubscribing and call CoDisconnectObject to release the server side stub references in the OnQuit notification fixes the crash. To aid debugging this issue in the future we now override the purecall handler in chrome frame tests. Bug=41980 TBR=amit Review URL: http://codereview.chromium.org/1695015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45569 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc5
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.h6
-rw-r--r--chrome_frame/test/run_all_unittests.cc6
3 files changed, 15 insertions, 2 deletions
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index a174a6b..1cc1f47 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -449,7 +449,10 @@ void WebBrowserEventSink::Attach(IDispatch* browser_disp) {
void WebBrowserEventSink::Uninitialize() {
DisconnectFromChromeFrame();
if (web_browser2_.get()) {
- DispEventUnadvise(web_browser2_);
+ if (m_dwEventCookie != 0xFEFEFEFE) {
+ CoDisconnectObject(this, 0);
+ DispEventUnadvise(web_browser2_);
+ }
ScopedHandle process;
// process_id_to_wait_for_ is set when we receive OnQuit.
diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h
index b7a3908..5a4e841 100644
--- a/chrome_frame/test/chrome_frame_test_utils.h
+++ b/chrome_frame/test/chrome_frame_test_utils.h
@@ -135,7 +135,8 @@ class WebBrowserEventSink
: public CComObjectRootEx<CComMultiThreadModel>,
public IDispEventSimpleImpl<0, WebBrowserEventSink,
&DIID_DWebBrowserEvents2>,
- public WindowObserver {
+ public WindowObserver,
+ public IUnknown {
public:
typedef IDispEventSimpleImpl<0, WebBrowserEventSink,
&DIID_DWebBrowserEvents2> DispEventsImpl;
@@ -155,6 +156,7 @@ class WebBrowserEventSink
}
BEGIN_COM_MAP(WebBrowserEventSink)
+ COM_INTERFACE_ENTRY(IUnknown)
END_COM_MAP()
BEGIN_SINK_MAP(WebBrowserEventSink)
@@ -240,6 +242,8 @@ END_SINK_MAP()
::GetWindowThreadProcessId(hwnd, &process_id_to_wait_for_);
OnQuit();
+ CoDisconnectObject(this, 0);
+ DispEventUnadvise(web_browser2_);
}
#ifdef _DEBUG
STDMETHOD(Invoke)(DISPID dispid, REFIID riid,
diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc
index 7772259..a943671 100644
--- a/chrome_frame/test/run_all_unittests.cc
+++ b/chrome_frame/test/run_all_unittests.cc
@@ -60,10 +60,16 @@ base::ProcessHandle LoadCrashService() {
return crash_service;
}
+void PureCall() {
+ __debugbreak();
+}
+
int main(int argc, char **argv) {
base::EnableTerminationOnHeapCorruption();
PlatformThread::SetName("ChromeFrame tests");
+ _set_purecall_handler(PureCall);
+
TestSuite test_suite(argc, argv);
if (CommandLine::ForCurrentProcess()->HasSwitch(kRunAsServer)) {